; LLVM IR from ahampriyanshu/algo-ds-101 :: Algorithms/Graph/Dijkstra/dijkstra_leftist_heap/dijkstra.ll (Z8dijkstra7WDGraphi)

; 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<VertexNode *, std::allocator<VertexNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<VertexNode *, std::allocator<VertexNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VertexNode *, std::allocator<VertexNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VertexNode *, std::allocator<VertexNode *>>::_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<EdgeNode *, std::allocator<EdgeNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<EdgeNode *, std::allocator<EdgeNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<EdgeNode *, std::allocator<EdgeNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<EdgeNode *, std::allocator<EdgeNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.LeftistHeap = type { ptr, ptr }
%class.WDGraph = type { ptr, i32, ptr }
%"struct.std::pair" = type { float, i32 }
%"struct.std::pair.9" = type { i32, i32 }
%class.VertexNode = type { i32, float, i32, i8, ptr, ptr, ptr }
%class.EdgeNode = type { i32, i32, float, ptr }

@vertices = external dso_local global %"class.std::vector", align 8
@EdgesToNeightbours = external dso_local global %"class.std::vector.0", align 8
@h = external dso_local global %class.LeftistHeap, align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8dijkstra7WDGraphi(ptr noundef byval(%class.WDGraph) align 8 %0, i32 noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair.9", align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca i64, align 8
  store i32 %1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @_ZNSt4pairIfiEC2IfiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @_ZNSt6vectorIP10VertexNodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @vertices) #4
  call void @_ZN7WDGraph11getverticesERSt6vectorIP10VertexNodeSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @vertices)
  %10 = load i32, ptr %3, align 4, !tbaa !5
  call void @_ZN7WDGraph20changeVertexDistanceEif(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %10, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %30, %2
  %12 = load i32, ptr %6, align 4, !tbaa !5
  %13 = getelementptr inbounds %class.WDGraph, ptr %0, i32 0, i32 1
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = icmp slt i32 %12, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %33

17:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %18 = load i32, ptr %6, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10VertexNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vertices, i64 noundef %19) #4
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = getelementptr inbounds %class.VertexNode, ptr %21, i32 0, i32 1
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10VertexNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vertices, i64 noundef %24) #4
  %26 = load ptr, ptr %25, align 8, !tbaa !12
  %27 = getelementptr inbounds %class.VertexNode, ptr %26, i32 0, i32 0
  %28 = call i64 @_ZSt9make_pairIRfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %27)
  store i64 %28, ptr %8, align 4
  call void @_ZNSt4pairIiiEC2IfiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8)
  %29 = load i64, ptr %7, align 4
  call void @_ZN11LeftistHeap6insertESt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(16) @h, i64 %29)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %30

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

33:                                               ; preds = %16
  br label %34

34:                                               ; preds = %129, %33
  %35 = call noundef zeroext i1 @_ZN11LeftistHeap7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) @h)
  %36 = xor i1 %35, true
  br i1 %36, label %37, label %130

37:                                               ; preds = %34
  call void @_ZN11LeftistHeap9deleteMinERSt4pairIfiE(ptr noundef nonnull align 8 dereferenceable(16) @h, ptr noundef nonnull align 4 dereferenceable(8) %4)
  %38 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !15
  %40 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %39)
  store ptr %40, ptr %5, align 8, !tbaa !12
  %41 = load ptr, ptr %5, align 8, !tbaa !12
  %42 = getelementptr inbounds %class.VertexNode, ptr %41, i32 0, i32 1
  %43 = load float, ptr %42, align 4, !tbaa !18
  %44 = fcmp une float %43, 1.000000e+07
  br i1 %44, label %45, label %48

45:                                               ; preds = %37
  %46 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !15
  call void @_ZN7WDGraph11visitVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %47)
  br label %48

48:                                               ; preds = %45, %37
  call void @_ZNSt6vectorIP8EdgeNodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours) #4
  %49 = load ptr, ptr %5, align 8, !tbaa !12
  %50 = getelementptr inbounds %class.VertexNode, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !21
  call void @_ZN7WDGraph14getNeightboursEiRSt6vectorIP8EdgeNodeSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %51, ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !22
  br label %52

52:                                               ; preds = %126, %48
  %53 = load i64, ptr %9, align 8, !tbaa !22
  %54 = call noundef i64 @_ZNKSt6vectorIP8EdgeNodeSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours) #4
  %55 = icmp ult i64 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %129

57:                                               ; preds = %52
  %58 = load i64, ptr %9, align 8, !tbaa !22
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %58) #4
  %60 = load ptr, ptr %59, align 8, !tbaa !12
  %61 = getelementptr inbounds %class.EdgeNode, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !24
  %63 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %62)
  %64 = getelementptr inbounds %class.VertexNode, ptr %63, i32 0, i32 3
  %65 = load i8, ptr %64, align 4, !tbaa !26, !range !27, !noundef !28
  %66 = trunc i8 %65 to i1
  br i1 %66, label %125, label %67

67:                                               ; preds = %57
  %68 = load ptr, ptr %5, align 8, !tbaa !12
  %69 = getelementptr inbounds %class.VertexNode, ptr %68, i32 0, i32 1
  %70 = load float, ptr %69, align 4, !tbaa !18
  %71 = load i64, ptr %9, align 8, !tbaa !22
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %71) #4
  %73 = load ptr, ptr %72, align 8, !tbaa !12
  %74 = getelementptr inbounds %class.EdgeNode, ptr %73, i32 0, i32 2
  %75 = load float, ptr %74, align 8, !tbaa !29
  %76 = fadd float %70, %75
  %77 = load i64, ptr %9, align 8, !tbaa !22
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %77) #4
  %79 = load ptr, ptr %78, align 8, !tbaa !12
  %80 = getelementptr inbounds %class.EdgeNode, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !24
  %82 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %81)
  %83 = getelementptr inbounds %class.VertexNode, ptr %82, i32 0, i32 1
  %84 = load float, ptr %83, align 4, !tbaa !18
  %85 = fcmp olt float %76, %84
  br i1 %85, label %86, label %125

86:                                               ; preds = %67
  %87 = load i64, ptr %9, align 8, !tbaa !22
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %87) #4
  %89 = load ptr, ptr %88, align 8, !tbaa !12
  %90 = getelementptr inbounds %class.EdgeNode, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !24
  %92 = load ptr, ptr %5, align 8, !tbaa !12
  %93 = getelementptr inbounds %class.VertexNode, ptr %92, i32 0, i32 1
  %94 = load float, ptr %93, align 4, !tbaa !18
  %95 = load i64, ptr %9, align 8, !tbaa !22
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %95) #4
  %97 = load ptr, ptr %96, align 8, !tbaa !12
  %98 = getelementptr inbounds %class.EdgeNode, ptr %97, i32 0, i32 2
  %99 = load float, ptr %98, align 8, !tbaa !29
  %100 = fadd float %94, %99
  call void @_ZN7WDGraph20changeVertexDistanceEif(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %91, float noundef %100)
  %101 = load ptr, ptr %5, align 8, !tbaa !12
  %102 = load i64, ptr %9, align 8, !tbaa !22
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %102) #4
  %104 = load ptr, ptr %103, align 8, !tbaa !12
  %105 = getelementptr inbounds %class.EdgeNode, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !24
  %107 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %106)
  %108 = getelementptr inbounds %class.VertexNode, ptr %107, i32 0, i32 4
  store ptr %101, ptr %108, align 8, !tbaa !30
  %109 = load i64, ptr %9, align 8, !tbaa !22
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %109) #4
  %111 = load ptr, ptr %110, align 8, !tbaa !12
  %112 = getelementptr inbounds %class.EdgeNode, ptr %111, i32 0, i32 1
  %113 = load i32, ptr %112, align 4, !tbaa !24
  %114 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %113)
  %115 = getelementptr inbounds %class.VertexNode, ptr %114, i32 0, i32 0
  %116 = load i32, ptr %115, align 8, !tbaa !21
  %117 = load i64, ptr %9, align 8, !tbaa !22
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %117) #4
  %119 = load ptr, ptr %118, align 8, !tbaa !12
  %120 = getelementptr inbounds %class.EdgeNode, ptr %119, i32 0, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !24
  %122 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %121)
  %123 = getelementptr inbounds %class.VertexNode, ptr %122, i32 0, i32 1
  %124 = load float, ptr %123, align 4, !tbaa !18
  call void @_ZN11LeftistHeap11decreaseKeyEif(ptr noundef nonnull align 8 dereferenceable(16) @h, i32 noundef %116, float noundef %124)
  br label %125

125:                                              ; preds = %86, %67, %57
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %9, align 8, !tbaa !22
  %128 = add i64 %127, 1
  store i64 %128, ptr %9, align 8, !tbaa !22
  br label %52, !llvm.loop !31

129:                                              ; preds = %56
  br label %34, !llvm.loop !32

130:                                              ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIfiEC2IfiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

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

declare void @_ZN7WDGraph11getverticesERSt6vectorIP10VertexNodeSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

declare void @_ZN7WDGraph20changeVertexDistanceEif(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, float noundef) #3

declare void @_ZN11LeftistHeap6insertESt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(16), i64) #3

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IfiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN11LeftistHeap7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16)) #3

declare void @_ZN11LeftistHeap9deleteMinERSt4pairIfiE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) #3

declare noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #3

declare void @_ZN7WDGraph11visitVertexEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #3

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

declare void @_ZN7WDGraph14getNeightboursEiRSt6vectorIP8EdgeNodeSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #3

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

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

declare void @_ZN11LeftistHeap11decreaseKeyEif(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, float noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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, !6, i64 8}
!10 = !{!"_ZTS7WDGraph", !11, i64 0, !6, i64 8, !11, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 4}
!16 = !{!"_ZTSSt4pairIfiE", !17, i64 0, !6, i64 4}
!17 = !{!"float", !7, i64 0}
!18 = !{!19, !17, i64 4}
!19 = !{!"_ZTS10VertexNode", !6, i64 0, !17, i64 4, !6, i64 8, !20, i64 12, !11, i64 16, !11, i64 24, !11, i64 32}
!20 = !{!"bool", !7, i64 0}
!21 = !{!19, !6, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!25, !6, i64 4}
!25 = !{!"_ZTS8EdgeNode", !6, i64 0, !6, i64 4, !17, i64 8, !11, i64 16}
!26 = !{!19, !20, i64 12}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!25, !17, i64 8}
!30 = !{!19, !11, i64 16}
!31 = distinct !{!31, !14}
!32 = distinct !{!32, !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<VertexNode *, std::allocator<VertexNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<VertexNode *, std::allocator<VertexNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VertexNode *, std::allocator<VertexNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VertexNode *, std::allocator<VertexNode *>>::_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<EdgeNode *, std::allocator<EdgeNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<EdgeNode *, std::allocator<EdgeNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<EdgeNode *, std::allocator<EdgeNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<EdgeNode *, std::allocator<EdgeNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.LeftistHeap = type { ptr, ptr }
%class.WDGraph = type { ptr, i32, ptr }
%"struct.std::pair" = type { float, i32 }
%"struct.std::pair.9" = type { i32, i32 }

@vertices = external dso_local global %"class.std::vector", align 8
@EdgesToNeightbours = external dso_local global %"class.std::vector.0", align 8
@h = external dso_local global %class.LeftistHeap, align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8dijkstra7WDGraphi(ptr noundef byval(%class.WDGraph) align 8 %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca %"struct.std::pair.9", align 8
  %5 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @_ZNSt4pairIfiEC2IfiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @_ZNSt6vectorIP10VertexNodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @vertices) #4
  call void @_ZN7WDGraph11getverticesERSt6vectorIP10VertexNodeSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @vertices)
  call void @_ZN7WDGraph20changeVertexDistanceEif(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, float noundef 0.000000e+00)
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %2
  %9 = call noundef zeroext i1 @_ZN11LeftistHeap7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) @h)
  br i1 %9, label %._crit_edge, label %.lr.ph23

.lr.ph23:                                         ; preds = %.preheader
  %10 = getelementptr inbounds i8, ptr %3, i64 4
  br label %22

.lr.ph:                                           ; preds = %2, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %2 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10VertexNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vertices, i64 noundef %indvars.iv) #4
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %12, i64 4
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10VertexNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vertices, i64 noundef %indvars.iv) #4
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = call i64 @_ZSt9make_pairIRfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %15)
  store i64 %16, ptr %5, align 8
  call void @_ZNSt4pairIiiEC2IfiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %17 = load i64, ptr %4, align 8
  call void @_ZN11LeftistHeap6insertESt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(16) @h, i64 %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr %6, align 8, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %.preheader, !llvm.loop !12

.loopexit:                                        ; preds = %86, %30
  %21 = call noundef zeroext i1 @_ZN11LeftistHeap7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) @h)
  br i1 %21, label %._crit_edge, label %22, !llvm.loop !14

22:                                               ; preds = %.lr.ph23, %.loopexit
  call void @_ZN11LeftistHeap9deleteMinERSt4pairIfiE(ptr noundef nonnull align 8 dereferenceable(16) @h, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %23 = load i32, ptr %10, align 4, !tbaa !15
  %24 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %23)
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  %26 = load float, ptr %25, align 4, !tbaa !18
  %27 = fcmp une float %26, 1.000000e+07
  br i1 %27, label %28, label %30

28:                                               ; preds = %22
  %29 = load i32, ptr %10, align 4, !tbaa !15
  call void @_ZN7WDGraph11visitVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %29)
  br label %30

30:                                               ; preds = %28, %22
  call void @_ZNSt6vectorIP8EdgeNodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours) #4
  %31 = load i32, ptr %24, align 8, !tbaa !21
  call void @_ZN7WDGraph14getNeightboursEiRSt6vectorIP8EdgeNodeSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %31, ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours)
  %32 = call noundef i64 @_ZNKSt6vectorIP8EdgeNodeSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours) #4
  %.not = icmp eq i64 %32, 0
  br i1 %.not, label %.loopexit, label %.lr.ph22

.lr.ph22:                                         ; preds = %30, %86
  %.021 = phi i64 [ %87, %86 ], [ 0, %30 ]
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %.021) #4
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !22
  %37 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %36)
  %38 = getelementptr inbounds i8, ptr %37, i64 12
  %39 = load i8, ptr %38, align 4, !tbaa !24, !range !25, !noundef !26
  %40 = trunc nuw i8 %39 to i1
  br i1 %40, label %86, label %41

41:                                               ; preds = %.lr.ph22
  %42 = load float, ptr %25, align 4, !tbaa !18
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %.021) #4
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load float, ptr %45, align 8, !tbaa !27
  %47 = fadd float %42, %46
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %.021) #4
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = getelementptr inbounds i8, ptr %49, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !22
  %52 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %51)
  %53 = getelementptr inbounds i8, ptr %52, i64 4
  %54 = load float, ptr %53, align 4, !tbaa !18
  %55 = fcmp olt float %47, %54
  br i1 %55, label %56, label %86

56:                                               ; preds = %41
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %.021) #4
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds i8, ptr %58, i64 4
  %60 = load i32, ptr %59, align 4, !tbaa !22
  %61 = load float, ptr %25, align 4, !tbaa !18
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %.021) #4
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load float, ptr %64, align 8, !tbaa !27
  %66 = fadd float %61, %65
  call void @_ZN7WDGraph20changeVertexDistanceEif(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %60, float noundef %66)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %.021) #4
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %69 = getelementptr inbounds i8, ptr %68, i64 4
  %70 = load i32, ptr %69, align 4, !tbaa !22
  %71 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %70)
  %72 = getelementptr inbounds i8, ptr %71, i64 16
  store ptr %24, ptr %72, align 8, !tbaa !28
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %.021) #4
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = getelementptr inbounds i8, ptr %74, i64 4
  %76 = load i32, ptr %75, align 4, !tbaa !22
  %77 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %76)
  %78 = load i32, ptr %77, align 8, !tbaa !21
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8EdgeNodeSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours, i64 noundef %.021) #4
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = getelementptr inbounds i8, ptr %80, i64 4
  %82 = load i32, ptr %81, align 4, !tbaa !22
  %83 = call noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %82)
  %84 = getelementptr inbounds i8, ptr %83, i64 4
  %85 = load float, ptr %84, align 4, !tbaa !18
  call void @_ZN11LeftistHeap11decreaseKeyEif(ptr noundef nonnull align 8 dereferenceable(16) @h, i32 noundef %78, float noundef %85)
  br label %86

86:                                               ; preds = %.lr.ph22, %41, %56
  %87 = add nuw i64 %.021, 1
  %88 = call noundef i64 @_ZNKSt6vectorIP8EdgeNodeSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @EdgesToNeightbours) #4
  %89 = icmp ult i64 %87, %88
  br i1 %89, label %.lr.ph22, label %.loopexit, !llvm.loop !29

._crit_edge:                                      ; preds = %.loopexit, %.preheader
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIfiEC2IfiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

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

declare void @_ZN7WDGraph11getverticesERSt6vectorIP10VertexNodeSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare void @_ZN7WDGraph20changeVertexDistanceEif(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, float noundef) local_unnamed_addr #3

declare void @_ZN11LeftistHeap6insertESt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(16), i64) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRfRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IfiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN11LeftistHeap7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

declare void @_ZN11LeftistHeap9deleteMinERSt4pairIfiE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

declare noundef ptr @_ZN7WDGraph9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #3

declare void @_ZN7WDGraph11visitVertexEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #3

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

declare void @_ZN7WDGraph14getNeightboursEiRSt6vectorIP8EdgeNodeSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

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

declare void @_ZN11LeftistHeap11decreaseKeyEif(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, float noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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, !10, i64 8}
!6 = !{!"_ZTS7WDGraph", !7, i64 0, !10, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !10, i64 4}
!16 = !{!"_ZTSSt4pairIfiE", !17, i64 0, !10, i64 4}
!17 = !{!"float", !8, i64 0}
!18 = !{!19, !17, i64 4}
!19 = !{!"_ZTS10VertexNode", !10, i64 0, !17, i64 4, !10, i64 8, !20, i64 12, !7, i64 16, !7, i64 24, !7, i64 32}
!20 = !{!"bool", !8, i64 0}
!21 = !{!19, !10, i64 0}
!22 = !{!23, !10, i64 4}
!23 = !{!"_ZTS8EdgeNode", !10, i64 0, !10, i64 4, !17, i64 8, !7, i64 16}
!24 = !{!19, !20, i64 12}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!23, !17, i64 8}
!28 = !{!19, !7, i64 16}
!29 = distinct !{!29, !13}


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