; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes (R3Mesh)

; 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.RNHeap.7 = type <{ ptr, i32, i32, i32, i32, ptr, ptr, ptr, i32, [4 x i8] }>
%class.R3Point = type { [3 x double] }
%struct.DijkstraData = type { ptr, ptr, double, ptr, double }

@RN_INFINITY = external global double, align 8
@stderr = external global ptr, align 8
@.str.43 = external hidden unnamed_addr constant [59 x i8], align 1
@_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap = external hidden global %class.RNHeap.7, align 8
@_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap = external hidden global i64, align 8
@__dso_handle = external hidden global i8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272)) #0 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272), i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #4 align 2

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

declare void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #0 align 2

declare noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, ptr noundef) #0 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7RNArrayIP10R3MeshEdgeE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #7 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeE(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #7 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca %class.R3Point, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.DijkstraData, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %31 = load double, ptr @RN_INFINITY, align 8, !tbaa !9
  store double %31, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #9
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %32)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %34 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %30)
  %35 = sext i32 %34 to i64
  %36 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %35, i64 40)
  %37 = extractvalue { i64, i1 } %36, 1
  %38 = extractvalue { i64, i1 } %36, 0
  %39 = select i1 %37, i64 -1, i64 %38
  %40 = call noalias noundef nonnull ptr @_Znam(i64 noundef %39) #11
  store ptr %40, ptr %12, align 8, !tbaa !5
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %47, label %43

43:                                               ; preds = %4
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str.43) #9
  %46 = load double, ptr @RN_INFINITY, align 8, !tbaa !9
  store double %46, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %246

47:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %48

48:                                               ; preds = %81, %47
  %49 = load i32, ptr %14, align 4, !tbaa !11
  %50 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %30)
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %84

53:                                               ; preds = %48
  %54 = load i32, ptr %14, align 4, !tbaa !11
  %55 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %30, i32 noundef %54)
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = load i32, ptr %14, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %struct.DijkstraData, ptr %56, i64 %58
  %60 = getelementptr inbounds %struct.DijkstraData, ptr %59, i32 0, i32 0
  store ptr %55, ptr %60, align 8, !tbaa !13
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = load i32, ptr %14, align 4, !tbaa !11
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds %struct.DijkstraData, ptr %61, i64 %63
  %65 = getelementptr inbounds %struct.DijkstraData, ptr %64, i32 0, i32 1
  store ptr null, ptr %65, align 8, !tbaa !15
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load i32, ptr %14, align 4, !tbaa !11
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds %struct.DijkstraData, ptr %66, i64 %68
  %70 = getelementptr inbounds %struct.DijkstraData, ptr %69, i32 0, i32 2
  store double -1.000000e+00, ptr %70, align 8, !tbaa !16
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = load i32, ptr %14, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.DijkstraData, ptr %71, i64 %73
  %75 = getelementptr inbounds %struct.DijkstraData, ptr %74, i32 0, i32 3
  store ptr null, ptr %75, align 8, !tbaa !17
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = load i32, ptr %14, align 4, !tbaa !11
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.DijkstraData, ptr %76, i64 %78
  %80 = getelementptr inbounds %struct.DijkstraData, ptr %79, i32 0, i32 4
  store double 0x47EFFFFFE0000000, ptr %80, align 8, !tbaa !18
  br label %81

81:                                               ; preds = %53
  %82 = load i32, ptr %14, align 4, !tbaa !11
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %14, align 4, !tbaa !11
  br label %48, !llvm.loop !19

84:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #9
  %85 = load atomic i8, ptr @_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap acquire, align 8
  %86 = icmp eq i8 %85, 0
  br i1 %86, label %87, label %95, !prof !21

87:                                               ; preds = %84
  %88 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap) #9
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %95

90:                                               ; preds = %87
  %91 = getelementptr inbounds %struct.DijkstraData, ptr %15, i32 0, i32 4
  %92 = getelementptr inbounds %struct.DijkstraData, ptr %15, i32 0, i32 3
  invoke void @_ZN6RNHeapIP12DijkstraDataEC2ES1_PdPPS1_i(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr noundef %15, ptr noundef %91, ptr noundef %92, i32 noundef 1)
          to label %93 unwind label %128

93:                                               ; preds = %90
  %94 = call i32 @__cxa_atexit(ptr @_ZN6RNHeapIP12DijkstraDataED2Ev, ptr @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr @__dso_handle) #9
  call void @__cxa_guard_release(ptr @_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap) #9
  br label %95

95:                                               ; preds = %93, %87, %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %97)
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds %struct.DijkstraData, ptr %96, i64 %99
  store ptr %100, ptr %18, align 8, !tbaa !5
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %101)
  %103 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 8 dereferenceable(24) %11)
  %104 = load ptr, ptr %18, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.DijkstraData, ptr %104, i32 0, i32 2
  store double %103, ptr %105, align 8, !tbaa !16
  %106 = load ptr, ptr %18, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.DijkstraData, ptr %106, i32 0, i32 2
  %108 = load double, ptr %107, align 8, !tbaa !16
  %109 = load ptr, ptr %18, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.DijkstraData, ptr %109, i32 0, i32 4
  store double %108, ptr %110, align 8, !tbaa !18
  %111 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr noundef %111)
  br label %112

112:                                              ; preds = %204, %95
  %113 = call noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap)
  %114 = icmp ne i32 %113, 0
  %115 = xor i1 %114, true
  br i1 %115, label %116, label %205

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %117 = call noundef ptr @_ZN6RNHeapIP12DijkstraDataE3PopEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap)
  store ptr %117, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %118 = load ptr, ptr %19, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.DijkstraData, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !13
  store ptr %120, ptr %20, align 8, !tbaa !5
  %121 = load ptr, ptr %20, align 8, !tbaa !5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = icmp eq ptr %121, %122
  br i1 %123, label %124, label %132

124:                                              ; preds = %116
  %125 = load ptr, ptr %19, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.DijkstraData, ptr %125, i32 0, i32 4
  %127 = load double, ptr %126, align 8, !tbaa !18
  store double %127, ptr %10, align 8, !tbaa !9
  store i32 6, ptr %13, align 4
  br label %202

128:                                              ; preds = %90
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %16, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %17, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %248

132:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %133

133:                                              ; preds = %198, %132
  %134 = load i32, ptr %21, align 4, !tbaa !11
  %135 = load ptr, ptr %20, align 8, !tbaa !5
  %136 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %135)
  %137 = icmp slt i32 %134, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %133
  store i32 7, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %201

139:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %140 = load ptr, ptr %20, align 8, !tbaa !5
  %141 = load i32, ptr %21, align 4, !tbaa !11
  %142 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %140, i32 noundef %141)
  store ptr %142, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  %143 = load ptr, ptr %22, align 8, !tbaa !5
  %144 = load ptr, ptr %20, align 8, !tbaa !5
  %145 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %143, ptr noundef %144)
  store ptr %145, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %146 = load ptr, ptr %12, align 8, !tbaa !5
  %147 = load ptr, ptr %23, align 8, !tbaa !5
  %148 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %147)
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds %struct.DijkstraData, ptr %146, i64 %149
  store ptr %150, ptr %24, align 8, !tbaa !5
  %151 = load ptr, ptr %24, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.DijkstraData, ptr %151, i32 0, i32 2
  %153 = load double, ptr %152, align 8, !tbaa !16
  %154 = fcmp oeq double %153, -1.000000e+00
  br i1 %154, label %155, label %162

155:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %156 = load ptr, ptr %23, align 8, !tbaa !5
  %157 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %156)
  store ptr %157, ptr %25, align 8, !tbaa !5
  %158 = load ptr, ptr %25, align 8, !tbaa !5
  %159 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %158, ptr noundef nonnull align 8 dereferenceable(24) %11)
  %160 = load ptr, ptr %24, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.DijkstraData, ptr %160, i32 0, i32 2
  store double %159, ptr %161, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %162

162:                                              ; preds = %155, %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %163 = load ptr, ptr %24, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.DijkstraData, ptr %163, i32 0, i32 4
  %165 = load double, ptr %164, align 8, !tbaa !18
  store double %165, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %166 = load ptr, ptr %22, align 8, !tbaa !5
  %167 = call noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %166)
  %168 = load ptr, ptr %19, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.DijkstraData, ptr %168, i32 0, i32 4
  %170 = load double, ptr %169, align 8, !tbaa !18
  %171 = fadd double %167, %170
  %172 = load ptr, ptr %19, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.DijkstraData, ptr %172, i32 0, i32 2
  %174 = load double, ptr %173, align 8, !tbaa !16
  %175 = fsub double %171, %174
  %176 = load ptr, ptr %24, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.DijkstraData, ptr %176, i32 0, i32 2
  %178 = load double, ptr %177, align 8, !tbaa !16
  %179 = fadd double %175, %178
  store double %179, ptr %27, align 8, !tbaa !9
  %180 = load double, ptr %27, align 8, !tbaa !9
  %181 = load double, ptr %26, align 8, !tbaa !9
  %182 = fcmp olt double %180, %181
  br i1 %182, label %183, label %197

183:                                              ; preds = %162
  %184 = load ptr, ptr %22, align 8, !tbaa !5
  %185 = load ptr, ptr %24, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.DijkstraData, ptr %185, i32 0, i32 1
  store ptr %184, ptr %186, align 8, !tbaa !15
  %187 = load double, ptr %27, align 8, !tbaa !9
  %188 = load ptr, ptr %24, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.DijkstraData, ptr %188, i32 0, i32 4
  store double %187, ptr %189, align 8, !tbaa !18
  %190 = load double, ptr %26, align 8, !tbaa !9
  %191 = fcmp olt double %190, 0x47EFFFFFE0000000
  br i1 %191, label %192, label %194

192:                                              ; preds = %183
  %193 = load ptr, ptr %24, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE6UpdateES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr noundef %193)
  br label %196

194:                                              ; preds = %183
  %195 = load ptr, ptr %24, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr noundef %195)
  br label %196

196:                                              ; preds = %194, %192
  br label %197

197:                                              ; preds = %196, %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %21, align 4, !tbaa !11
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %21, align 4, !tbaa !11
  br label %133, !llvm.loop !22

201:                                              ; preds = %138
  store i32 0, ptr %13, align 4
  br label %202

202:                                              ; preds = %201, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  %203 = load i32, ptr %13, align 4
  switch i32 %203, label %253 [
    i32 0, label %204
    i32 6, label %205
  ]

204:                                              ; preds = %202
  br label %112, !llvm.loop !23

205:                                              ; preds = %202, %112
  %206 = load ptr, ptr %9, align 8, !tbaa !5
  %207 = icmp ne ptr %206, null
  br i1 %207, label %208, label %240

208:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %209, ptr %28, align 8, !tbaa !5
  br label %210

210:                                              ; preds = %238, %208
  %211 = load ptr, ptr %28, align 8, !tbaa !5
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = icmp ne ptr %211, %212
  br i1 %213, label %214, label %239

214:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %215 = load ptr, ptr %12, align 8, !tbaa !5
  %216 = load ptr, ptr %28, align 8, !tbaa !5
  %217 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %216)
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds %struct.DijkstraData, ptr %215, i64 %218
  store ptr %219, ptr %29, align 8, !tbaa !5
  %220 = load ptr, ptr %29, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.DijkstraData, ptr %220, i32 0, i32 1
  %222 = load ptr, ptr %221, align 8, !tbaa !15
  %223 = icmp ne ptr %222, null
  br i1 %223, label %225, label %224

224:                                              ; preds = %214
  store i32 11, ptr %13, align 4
  br label %236

225:                                              ; preds = %214
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = load ptr, ptr %29, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.DijkstraData, ptr %227, i32 0, i32 1
  %229 = load ptr, ptr %228, align 8, !tbaa !15
  %230 = call noundef ptr @_ZN7RNArrayIP10R3MeshEdgeE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %226, ptr noundef %229)
  %231 = load ptr, ptr %29, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.DijkstraData, ptr %231, i32 0, i32 1
  %233 = load ptr, ptr %232, align 8, !tbaa !15
  %234 = load ptr, ptr %28, align 8, !tbaa !5
  %235 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %233, ptr noundef %234)
  store ptr %235, ptr %28, align 8, !tbaa !5
  store i32 0, ptr %13, align 4
  br label %236

236:                                              ; preds = %225, %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  %237 = load i32, ptr %13, align 4
  switch i32 %237, label %253 [
    i32 0, label %238
    i32 11, label %239
  ]

238:                                              ; preds = %236
  br label %210, !llvm.loop !24

239:                                              ; preds = %236, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  br label %240

240:                                              ; preds = %239, %205
  call void @_ZN6RNHeapIP12DijkstraDataE5EmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap)
  %241 = load ptr, ptr %12, align 8, !tbaa !5
  %242 = icmp eq ptr %241, null
  br i1 %242, label %244, label %243

243:                                              ; preds = %240
  call void @_ZdaPv(ptr noundef %241) #12
  br label %244

244:                                              ; preds = %243, %240
  %245 = load double, ptr %10, align 8, !tbaa !9
  store double %245, ptr %5, align 8
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #9
  br label %246

246:                                              ; preds = %244, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  %247 = load double, ptr %5, align 8
  ret double %247

248:                                              ; preds = %128
  %249 = load ptr, ptr %16, align 8
  %250 = load i32, ptr %17, align 4
  %251 = insertvalue { ptr, i32 } poison, ptr %249, 0
  %252 = insertvalue { ptr, i32 } %251, i32 %250, 1
  resume { ptr, i32 } %252

253:                                              ; preds = %236, %202
  unreachable
}

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #8

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #9

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6RNHeapIP12DijkstraDataEC2ES1_PdPPS1_i(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef, ptr noundef, ptr noundef, i32 noundef) unnamed_addr #7 align 2

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

; Function Attrs: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #9

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #9

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #9

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52)) #10 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN6RNHeapIP12DijkstraDataE3PopEv(ptr noundef nonnull align 8 dereferenceable(52)) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6RNHeapIP12DijkstraDataE6UpdateES1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6RNHeapIP12DijkstraDataE5EmptyEv(ptr noundef nonnull align 8 dereferenceable(52)) #7 align 2

attributes #0 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 #6 = { nobuiltin nounwind "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 #7 = { 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 #8 = { nounwind "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 #9 = { nounwind }
attributes #10 = { 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 #11 = { builtin allocsize(0) }
attributes #12 = { builtin 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS12DijkstraData", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32}
!15 = !{!14, !6, i64 8}
!16 = !{!14, !10, i64 16}
!17 = !{!14, !6, i64 24}
!18 = !{!14, !10, i64 32}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!"branch_weights", i32 1, i32 1048575}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}


; 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.RNHeap.7 = type <{ ptr, i32, i32, i32, i32, ptr, ptr, ptr, i32, [4 x i8] }>
%class.R3Point = type { [3 x double] }
%struct.DijkstraData = type { ptr, ptr, double, ptr, double }

@RN_INFINITY = external local_unnamed_addr global double, align 8
@_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap = external hidden global %class.RNHeap.7, align 8
@_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap = external hidden global i64, align 8
@__dso_handle = external hidden global i8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272), i32 noundef) local_unnamed_addr #0 align 2

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

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

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

declare void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #0 align 2

declare noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7RNArrayIP10R3MeshEdgeE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeE(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #7 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.R3Point, align 8
  %6 = alloca %struct.DijkstraData, align 8
  %7 = load double, ptr @RN_INFINITY, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #10
  %8 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %2)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %8)
  %9 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %10 = sext i32 %9 to i64
  %11 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %10, i64 40)
  %12 = extractvalue { i64, i1 } %11, 1
  %13 = extractvalue { i64, i1 } %11, 0
  %14 = select i1 %12, i64 -1, i64 %13
  %15 = call noalias noundef nonnull ptr @_Znam(i64 noundef %14) #11
  %16 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #10
  %18 = load atomic i8, ptr @_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap acquire, align 8
  %19 = icmp eq i8 %18, 0
  br i1 %19, label %30, label %37, !prof !9

.lr.ph:                                           ; preds = %4, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %4 ]
  %20 = trunc nuw nsw i64 %indvars.iv to i32
  %21 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %20)
  %22 = getelementptr inbounds %struct.DijkstraData, ptr %15, i64 %indvars.iv
  store ptr %21, ptr %22, align 8, !tbaa !10
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  store ptr null, ptr %23, align 8, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %22, i64 16
  store double -1.000000e+00, ptr %24, align 8, !tbaa !14
  %25 = getelementptr inbounds i8, ptr %22, i64 24
  store ptr null, ptr %25, align 8, !tbaa !15
  %26 = getelementptr inbounds i8, ptr %22, i64 32
  store double 0x47EFFFFFE0000000, ptr %26, align 8, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !17

30:                                               ; preds = %._crit_edge
  %31 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap) #10
  %.not = icmp eq i32 %31, 0
  br i1 %.not, label %37, label %32

32:                                               ; preds = %30
  %33 = getelementptr inbounds i8, ptr %6, i64 32
  %34 = getelementptr inbounds i8, ptr %6, i64 24
  invoke void @_ZN6RNHeapIP12DijkstraDataEC2ES1_PdPPS1_i(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr noundef nonnull %6, ptr noundef nonnull %33, ptr noundef nonnull %34, i32 noundef 1)
          to label %35 unwind label %56

35:                                               ; preds = %32
  %36 = call i32 @__cxa_atexit(ptr nonnull @_ZN6RNHeapIP12DijkstraDataED2Ev, ptr nonnull @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr nonnull @__dso_handle) #10
  call void @__cxa_guard_release(ptr nonnull @_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap) #10
  br label %37

37:                                               ; preds = %35, %30, %._crit_edge
  %38 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1)
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %struct.DijkstraData, ptr %15, i64 %39
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1)
  %42 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %43 = getelementptr inbounds i8, ptr %40, i64 16
  store double %42, ptr %43, align 8, !tbaa !14
  %44 = getelementptr inbounds i8, ptr %40, i64 32
  store double %42, ptr %44, align 8, !tbaa !16
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr noundef nonnull %40)
  %45 = call noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap)
  %.not83101 = icmp eq i32 %45, 0
  br i1 %.not83101, label %.lr.ph103, label %.loopexit97

.loopexit:                                        ; preds = %86, %.preheader96
  %46 = call noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap)
  %.not83 = icmp eq i32 %46, 0
  br i1 %.not83, label %.lr.ph103, label %.loopexit97

.lr.ph103:                                        ; preds = %37, %.loopexit
  %47 = call noundef ptr @_ZN6RNHeapIP12DijkstraDataE3PopEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap)
  %48 = load ptr, ptr %47, align 8, !tbaa !10
  %49 = icmp eq ptr %48, %2
  br i1 %49, label %.thread, label %.preheader96

.preheader96:                                     ; preds = %.lr.ph103
  %50 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %48)
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph100, label %.loopexit

.lr.ph100:                                        ; preds = %.preheader96
  %52 = getelementptr inbounds i8, ptr %47, i64 32
  %53 = getelementptr inbounds i8, ptr %47, i64 16
  br label %58

.thread:                                          ; preds = %.lr.ph103
  %54 = getelementptr inbounds i8, ptr %47, i64 32
  %55 = load double, ptr %54, align 8, !tbaa !16
  br label %.loopexit97

56:                                               ; preds = %32
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap) #10
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #10
  resume { ptr, i32 } %57

58:                                               ; preds = %.lr.ph100, %86
  %.07799 = phi i32 [ 0, %.lr.ph100 ], [ %87, %86 ]
  %59 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %48, i32 noundef %.07799)
  %60 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %59, ptr noundef %48)
  %61 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %60)
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds %struct.DijkstraData, ptr %15, i64 %62
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %65 = load double, ptr %64, align 8, !tbaa !14
  %66 = fcmp oeq double %65, -1.000000e+00
  br i1 %66, label %67, label %70

67:                                               ; preds = %58
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %60)
  %69 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 8 dereferenceable(24) %5)
  store double %69, ptr %64, align 8, !tbaa !14
  br label %70

70:                                               ; preds = %67, %58
  %71 = getelementptr inbounds i8, ptr %63, i64 32
  %72 = load double, ptr %71, align 8, !tbaa !16
  %73 = call noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %59)
  %74 = load double, ptr %52, align 8, !tbaa !16
  %75 = fadd double %73, %74
  %76 = load double, ptr %53, align 8, !tbaa !14
  %77 = fsub double %75, %76
  %78 = load double, ptr %64, align 8, !tbaa !14
  %79 = fadd double %77, %78
  %80 = fcmp olt double %79, %72
  br i1 %80, label %81, label %86

81:                                               ; preds = %70
  %82 = getelementptr inbounds i8, ptr %63, i64 8
  store ptr %59, ptr %82, align 8, !tbaa !13
  store double %79, ptr %71, align 8, !tbaa !16
  %83 = fcmp olt double %72, 0x47EFFFFFE0000000
  br i1 %83, label %84, label %85

84:                                               ; preds = %81
  call void @_ZN6RNHeapIP12DijkstraDataE6UpdateES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr noundef nonnull %63)
  br label %86

85:                                               ; preds = %81
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap, ptr noundef nonnull %63)
  br label %86

86:                                               ; preds = %84, %85, %70
  %87 = add nuw nsw i32 %.07799, 1
  %88 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %48)
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %58, label %.loopexit, !llvm.loop !19

.loopexit97:                                      ; preds = %.loopexit, %37, %.thread
  %.2 = phi double [ %55, %.thread ], [ %7, %37 ], [ %7, %.loopexit ]
  %.not84 = icmp eq ptr %3, null
  %.not85104 = icmp eq ptr %2, %1
  %or.cond = or i1 %.not84, %.not85104
  br i1 %or.cond, label %.thread92, label %.lr.ph106

.lr.ph106:                                        ; preds = %.loopexit97, %94
  %.071105 = phi ptr [ %97, %94 ], [ %2, %.loopexit97 ]
  %90 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %.071105)
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds %struct.DijkstraData, ptr %15, i64 %91, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !13
  %.not86 = icmp eq ptr %93, null
  br i1 %.not86, label %.thread92, label %94

94:                                               ; preds = %.lr.ph106
  %95 = call noundef ptr @_ZN7RNArrayIP10R3MeshEdgeE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull %93)
  %96 = load ptr, ptr %92, align 8, !tbaa !13
  %97 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %96, ptr noundef %.071105)
  %.not85 = icmp eq ptr %97, %1
  br i1 %.not85, label %.thread92, label %.lr.ph106

.thread92:                                        ; preds = %94, %.lr.ph106, %.loopexit97
  call void @_ZN6RNHeapIP12DijkstraDataE5EmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh16DijkstraDistanceEPK12R3MeshVertexS2_P7RNArrayIP10R3MeshEdgeEE4heap)
  call void @_ZdaPv(ptr noundef nonnull %15) #12
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #10
  ret double %.2
}

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6RNHeapIP12DijkstraDataEC2ES1_PdPPS1_i(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef, ptr noundef, ptr noundef, i32 noundef) unnamed_addr #7 align 2

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) local_unnamed_addr #8

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #8

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #9 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN6RNHeapIP12DijkstraDataE3PopEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6RNHeapIP12DijkstraDataE6UpdateES1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6RNHeapIP12DijkstraDataE5EmptyEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #7 align 2

attributes #0 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 #6 = { nobuiltin nounwind "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 #7 = { 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 #8 = { nofree nounwind }
attributes #9 = { 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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !12, i64 0}
!11 = !{!"_ZTS12DijkstraData", !12, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !6, i64 32}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!11, !12, i64 8}
!14 = !{!11, !6, i64 16}
!15 = !{!11, !12, i64 24}
!16 = !{!11, !6, i64 32}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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