; 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] }>
%struct.DijkstraData = type { ptr, ptr, double, ptr, double }

@stderr = external global ptr, align 8
@.str.43 = external hidden unnamed_addr constant [59 x i8], align 1
@__dso_handle = external hidden global i8
@.str.44 = external hidden unnamed_addr constant [40 x i8], align 1
@_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap = external hidden global %class.RNHeap.7, align 8
@_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap = external hidden global i64, align 8

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

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

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

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

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

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #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 #6 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: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #8

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

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

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

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

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

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

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

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

38:                                               ; preds = %4
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.44) #8
  store ptr null, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %235

41:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %42 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %28)
  %43 = sext i32 %42 to i64
  %44 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %43, i64 40)
  %45 = extractvalue { i64, i1 } %44, 1
  %46 = extractvalue { i64, i1 } %44, 0
  %47 = select i1 %45, i64 -1, i64 %46
  %48 = call noalias noundef nonnull ptr @_Znam(i64 noundef %47) #10
  store ptr %48, ptr %12, align 8, !tbaa !5
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %58, label %51

51:                                               ; preds = %41
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str.43) #8
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = icmp eq ptr %54, null
  br i1 %55, label %57, label %56

56:                                               ; preds = %51
  call void @_ZdaPv(ptr noundef %54) #11
  br label %57

57:                                               ; preds = %56, %51
  store ptr null, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %234

58:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %59

59:                                               ; preds = %96, %58
  %60 = load i32, ptr %13, align 4, !tbaa !11
  %61 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %28)
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %99

64:                                               ; preds = %59
  %65 = load i32, ptr %13, align 4, !tbaa !11
  %66 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %28, i32 noundef %65)
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = load i32, ptr %13, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds %struct.DijkstraData, ptr %67, i64 %69
  %71 = getelementptr inbounds %struct.DijkstraData, ptr %70, i32 0, i32 0
  store ptr %66, ptr %71, align 8, !tbaa !13
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load i32, ptr %13, align 4, !tbaa !11
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds %struct.DijkstraData, ptr %72, i64 %74
  %76 = getelementptr inbounds %struct.DijkstraData, ptr %75, i32 0, i32 1
  store ptr null, ptr %76, align 8, !tbaa !15
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = load i32, ptr %13, align 4, !tbaa !11
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds %struct.DijkstraData, ptr %77, i64 %79
  %81 = getelementptr inbounds %struct.DijkstraData, ptr %80, i32 0, i32 2
  store double -1.000000e+00, ptr %81, align 8, !tbaa !16
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = load i32, ptr %13, align 4, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds %struct.DijkstraData, ptr %82, i64 %84
  %86 = getelementptr inbounds %struct.DijkstraData, ptr %85, i32 0, i32 3
  store ptr null, ptr %86, align 8, !tbaa !17
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = load i32, ptr %13, align 4, !tbaa !11
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %struct.DijkstraData, ptr %87, i64 %89
  %91 = getelementptr inbounds %struct.DijkstraData, ptr %90, i32 0, i32 4
  store double 0x47EFFFFFE0000000, ptr %91, align 8, !tbaa !18
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = load i32, ptr %13, align 4, !tbaa !11
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  store double 0x47EFFFFFE0000000, ptr %95, align 8, !tbaa !9
  br label %96

96:                                               ; preds = %64
  %97 = load i32, ptr %13, align 4, !tbaa !11
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %13, align 4, !tbaa !11
  br label %59, !llvm.loop !19

99:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #8
  %100 = load atomic i8, ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap acquire, align 8
  %101 = icmp eq i8 %100, 0
  br i1 %101, label %102, label %110, !prof !21

102:                                              ; preds = %99
  %103 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap) #8
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %110

105:                                              ; preds = %102
  %106 = getelementptr inbounds %struct.DijkstraData, ptr %14, i32 0, i32 4
  %107 = getelementptr inbounds %struct.DijkstraData, ptr %14, i32 0, i32 3
  invoke void @_ZN6RNHeapIP12DijkstraDataEC2ES1_PdPPS1_i(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr noundef %14, ptr noundef %106, ptr noundef %107, i32 noundef 1)
          to label %108 unwind label %117

108:                                              ; preds = %105
  %109 = call i32 @__cxa_atexit(ptr @_ZN6RNHeapIP12DijkstraDataED2Ev, ptr @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr @__dso_handle) #8
  call void @__cxa_guard_release(ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap) #8
  br label %110

110:                                              ; preds = %108, %102, %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %111

111:                                              ; preds = %133, %110
  %112 = load i32, ptr %17, align 4, !tbaa !11
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %113)
  %115 = icmp slt i32 %112, %114
  br i1 %115, label %121, label %116

116:                                              ; preds = %111
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %136

117:                                              ; preds = %105
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %15, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %16, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %237

121:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load i32, ptr %17, align 4, !tbaa !11
  %124 = call noundef ptr @_ZNK7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %122, i32 noundef %123)
  store ptr %124, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  %126 = load ptr, ptr %18, align 8, !tbaa !5
  %127 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %126)
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds %struct.DijkstraData, ptr %125, i64 %128
  store ptr %129, ptr %19, align 8, !tbaa !5
  %130 = load ptr, ptr %19, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.DijkstraData, ptr %130, i32 0, i32 4
  store double 0.000000e+00, ptr %131, align 8, !tbaa !18
  %132 = load ptr, ptr %19, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr noundef %132)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %133

133:                                              ; preds = %121
  %134 = load i32, ptr %17, align 4, !tbaa !11
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %17, align 4, !tbaa !11
  br label %111, !llvm.loop !22

136:                                              ; preds = %116
  br label %137

137:                                              ; preds = %227, %136
  %138 = call noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap)
  %139 = icmp ne i32 %138, 0
  %140 = xor i1 %139, true
  br i1 %140, label %141, label %228

141:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %142 = call noundef ptr @_ZN6RNHeapIP12DijkstraDataE3PopEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap)
  store ptr %142, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %143 = load ptr, ptr %20, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.DijkstraData, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !13
  store ptr %145, ptr %21, align 8, !tbaa !5
  %146 = load double, ptr %8, align 8, !tbaa !9
  %147 = fcmp ogt double %146, 0.000000e+00
  br i1 %147, label %148, label %155

148:                                              ; preds = %141
  %149 = load ptr, ptr %20, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.DijkstraData, ptr %149, i32 0, i32 4
  %151 = load double, ptr %150, align 8, !tbaa !18
  %152 = load double, ptr %8, align 8, !tbaa !9
  %153 = fcmp ogt double %151, %152
  br i1 %153, label %154, label %155

154:                                              ; preds = %148
  store i32 9, ptr %11, align 4
  br label %225

155:                                              ; preds = %148, %141
  %156 = load ptr, ptr %20, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.DijkstraData, ptr %156, i32 0, i32 4
  %158 = load double, ptr %157, align 8, !tbaa !18
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = load ptr, ptr %21, align 8, !tbaa !5
  %161 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %160)
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds double, ptr %159, i64 %162
  store double %158, ptr %163, align 8, !tbaa !9
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = icmp ne ptr %164, null
  br i1 %165, label %166, label %175

166:                                              ; preds = %155
  %167 = load ptr, ptr %20, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.DijkstraData, ptr %167, i32 0, i32 1
  %169 = load ptr, ptr %168, align 8, !tbaa !15
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = load ptr, ptr %21, align 8, !tbaa !5
  %172 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %171)
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds ptr, ptr %170, i64 %173
  store ptr %169, ptr %174, align 8, !tbaa !5
  br label %175

175:                                              ; preds = %166, %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %176

176:                                              ; preds = %221, %175
  %177 = load i32, ptr %22, align 4, !tbaa !11
  %178 = load ptr, ptr %21, align 8, !tbaa !5
  %179 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %178)
  %180 = icmp slt i32 %177, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %176
  store i32 10, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %224

182:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %183 = load ptr, ptr %21, align 8, !tbaa !5
  %184 = load i32, ptr %22, align 4, !tbaa !11
  %185 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %183, i32 noundef %184)
  store ptr %185, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %186 = load ptr, ptr %23, align 8, !tbaa !5
  %187 = load ptr, ptr %21, align 8, !tbaa !5
  %188 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %186, ptr noundef %187)
  store ptr %188, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %189 = load ptr, ptr %12, align 8, !tbaa !5
  %190 = load ptr, ptr %24, align 8, !tbaa !5
  %191 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %190)
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds %struct.DijkstraData, ptr %189, i64 %192
  store ptr %193, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %194 = load ptr, ptr %25, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.DijkstraData, ptr %194, i32 0, i32 4
  %196 = load double, ptr %195, align 8, !tbaa !18
  store double %196, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %197 = load ptr, ptr %23, align 8, !tbaa !5
  %198 = call noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %197)
  %199 = load ptr, ptr %20, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.DijkstraData, ptr %199, i32 0, i32 4
  %201 = load double, ptr %200, align 8, !tbaa !18
  %202 = fadd double %198, %201
  store double %202, ptr %27, align 8, !tbaa !9
  %203 = load double, ptr %27, align 8, !tbaa !9
  %204 = load double, ptr %26, align 8, !tbaa !9
  %205 = fcmp olt double %203, %204
  br i1 %205, label %206, label %220

206:                                              ; preds = %182
  %207 = load ptr, ptr %23, align 8, !tbaa !5
  %208 = load ptr, ptr %25, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.DijkstraData, ptr %208, i32 0, i32 1
  store ptr %207, ptr %209, align 8, !tbaa !15
  %210 = load double, ptr %27, align 8, !tbaa !9
  %211 = load ptr, ptr %25, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.DijkstraData, ptr %211, i32 0, i32 4
  store double %210, ptr %212, align 8, !tbaa !18
  %213 = load double, ptr %26, align 8, !tbaa !9
  %214 = fcmp olt double %213, 0x47EFFFFFE0000000
  br i1 %214, label %215, label %217

215:                                              ; preds = %206
  %216 = load ptr, ptr %25, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE6UpdateES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr noundef %216)
  br label %219

217:                                              ; preds = %206
  %218 = load ptr, ptr %25, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr noundef %218)
  br label %219

219:                                              ; preds = %217, %215
  br label %220

220:                                              ; preds = %219, %182
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %22, align 4, !tbaa !11
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %22, align 4, !tbaa !11
  br label %176, !llvm.loop !23

224:                                              ; preds = %181
  store i32 0, ptr %11, align 4
  br label %225

225:                                              ; preds = %224, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  %226 = load i32, ptr %11, align 4
  switch i32 %226, label %242 [
    i32 0, label %227
    i32 9, label %228
  ]

227:                                              ; preds = %225
  br label %137, !llvm.loop !24

228:                                              ; preds = %225, %137
  call void @_ZN6RNHeapIP12DijkstraDataE5EmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap)
  %229 = load ptr, ptr %12, align 8, !tbaa !5
  %230 = icmp eq ptr %229, null
  br i1 %230, label %232, label %231

231:                                              ; preds = %228
  call void @_ZdaPv(ptr noundef %229) #11
  br label %232

232:                                              ; preds = %231, %228
  %233 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %233, ptr %5, align 8
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #8
  br label %234

234:                                              ; preds = %232, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %235

235:                                              ; preds = %234, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %236 = load ptr, ptr %5, align 8
  ret ptr %236

237:                                              ; preds = %117
  %238 = load ptr, ptr %15, align 8
  %239 = load i32, ptr %16, align 4
  %240 = insertvalue { ptr, i32 } poison, ptr %238, 0
  %241 = insertvalue { ptr, i32 } %240, i32 %239, 1
  resume { ptr, i32 } %241

242:                                              ; preds = %225
  unreachable
}

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 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 = { builtin allocsize(0) }
attributes #11 = { 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] }>
%struct.DijkstraData = type { ptr, ptr, double, ptr, double }

@__dso_handle = external hidden global i8
@_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap = external hidden global %class.RNHeap.7, align 8
@_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap = external hidden global i64, align 8

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

; 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

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

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

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

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

; 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 #6 align 2

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noalias noundef nonnull ptr @_ZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, double noundef %2, ptr noundef writeonly %3) local_unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.DijkstraData, align 8
  %6 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %7 = zext nneg i32 %6 to i64
  %8 = icmp slt i32 %6, 0
  %9 = shl nuw nsw i64 %7, 3
  %10 = select i1 %8, i64 -1, i64 %9
  %11 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %10) #9
  %12 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %13 = sext i32 %12 to i64
  %14 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %13, i64 40)
  %15 = extractvalue { i64, i1 } %14, 1
  %16 = extractvalue { i64, i1 } %14, 0
  %17 = select i1 %15, i64 -1, i64 %16
  %18 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %17) #9
  %19 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #10
  %21 = load atomic i8, ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap acquire, align 8
  %22 = icmp eq i8 %21, 0
  br i1 %22, label %34, label %41, !prof !5

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

34:                                               ; preds = %._crit_edge
  %35 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap) #10
  %.not = icmp eq i32 %35, 0
  br i1 %.not, label %41, label %36

36:                                               ; preds = %34
  %37 = getelementptr inbounds i8, ptr %5, i64 32
  %38 = getelementptr inbounds i8, ptr %5, i64 24
  invoke void @_ZN6RNHeapIP12DijkstraDataEC2ES1_PdPPS1_i(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr noundef nonnull %5, ptr noundef nonnull %37, ptr noundef nonnull %38, i32 noundef 1)
          to label %39 unwind label %46

39:                                               ; preds = %36
  %40 = call i32 @__cxa_atexit(ptr nonnull @_ZN6RNHeapIP12DijkstraDataED2Ev, ptr nonnull @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr nonnull @__dso_handle) #10
  call void @__cxa_guard_release(ptr nonnull @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap) #10
  br label %41

41:                                               ; preds = %39, %34, %._crit_edge
  %42 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph80, label %.preheader

.preheader:                                       ; preds = %.lr.ph80, %41
  %44 = call noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap)
  %.not7384 = icmp eq i32 %44, 0
  br i1 %.not7384, label %.lr.ph85, label %.thread

.lr.ph85:                                         ; preds = %.preheader
  %45 = fcmp ogt double %2, 0.000000e+00
  %.not74 = icmp eq ptr %3, null
  br label %57

46:                                               ; preds = %36
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap) #10
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #10
  resume { ptr, i32 } %47

.lr.ph80:                                         ; preds = %41, %.lr.ph80
  %.06778 = phi i32 [ %53, %.lr.ph80 ], [ 0, %41 ]
  %48 = call noundef ptr @_ZNK7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.06778)
  %49 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %48)
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %struct.DijkstraData, ptr %18, i64 %50
  %52 = getelementptr inbounds i8, ptr %51, i64 32
  store double 0.000000e+00, ptr %52, align 8, !tbaa !15
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr noundef nonnull %51)
  %53 = add nuw nsw i32 %.06778, 1
  %54 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %.lr.ph80, label %.preheader, !llvm.loop !19

.loopexit:                                        ; preds = %92, %73
  %56 = call noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap)
  %.not73 = icmp eq i32 %56, 0
  br i1 %.not73, label %57, label %.thread

57:                                               ; preds = %.lr.ph85, %.loopexit
  %58 = call noundef ptr @_ZN6RNHeapIP12DijkstraDataE3PopEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap)
  %59 = load ptr, ptr %58, align 8, !tbaa !6
  %60 = getelementptr inbounds i8, ptr %58, i64 32
  %61 = load double, ptr %60, align 8, !tbaa !15
  %62 = fcmp ogt double %61, %2
  %or.cond = select i1 %45, i1 %62, i1 false
  br i1 %or.cond, label %.thread, label %._crit_edge88

._crit_edge88:                                    ; preds = %57
  %63 = getelementptr inbounds i8, ptr %58, i64 32
  %64 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %59)
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds double, ptr %11, i64 %65
  store double %61, ptr %66, align 8, !tbaa !16
  br i1 %.not74, label %73, label %67

67:                                               ; preds = %._crit_edge88
  %68 = getelementptr inbounds i8, ptr %58, i64 8
  %69 = load ptr, ptr %68, align 8, !tbaa !12
  %70 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %59)
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds ptr, ptr %3, i64 %71
  store ptr %69, ptr %72, align 8, !tbaa !20
  br label %73

73:                                               ; preds = %67, %._crit_edge88
  %74 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %59)
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.lr.ph83, label %.loopexit

.lr.ph83:                                         ; preds = %73, %92
  %.06881 = phi i32 [ %93, %92 ], [ 0, %73 ]
  %76 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %59, i32 noundef %.06881)
  %77 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %76, ptr noundef %59)
  %78 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %77)
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds %struct.DijkstraData, ptr %18, i64 %79
  %81 = getelementptr inbounds i8, ptr %80, i64 32
  %82 = load double, ptr %81, align 8, !tbaa !15
  %83 = call noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %76)
  %84 = load double, ptr %63, align 8, !tbaa !15
  %85 = fadd double %83, %84
  %86 = fcmp olt double %85, %82
  br i1 %86, label %87, label %92

87:                                               ; preds = %.lr.ph83
  %88 = getelementptr inbounds i8, ptr %80, i64 8
  store ptr %76, ptr %88, align 8, !tbaa !12
  store double %85, ptr %81, align 8, !tbaa !15
  %89 = fcmp olt double %82, 0x47EFFFFFE0000000
  br i1 %89, label %90, label %91

90:                                               ; preds = %87
  call void @_ZN6RNHeapIP12DijkstraDataE6UpdateES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr noundef nonnull %80)
  br label %92

91:                                               ; preds = %87
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap, ptr noundef nonnull %80)
  br label %92

92:                                               ; preds = %90, %91, %.lr.ph83
  %93 = add nuw nsw i32 %.06881, 1
  %94 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %59)
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %.lr.ph83, label %.loopexit, !llvm.loop !21

.thread:                                          ; preds = %.loopexit, %57, %.preheader
  call void @_ZN6RNHeapIP12DijkstraDataE5EmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdPP10R3MeshEdgeE4heap)
  call void @_ZdaPv(ptr noundef nonnull %18) #11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #10
  ret ptr %11
}

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 = { 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 #6 = { 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 #7 = { nofree nounwind }
attributes #8 = { 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 #9 = { builtin allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { 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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = !{!7, !8, i64 0}
!7 = !{!"_ZTS12DijkstraData", !8, i64 0, !8, i64 8, !11, i64 16, !8, i64 24, !11, i64 32}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!7, !8, i64 8}
!13 = !{!7, !11, i64 16}
!14 = !{!7, !8, i64 24}
!15 = !{!7, !11, i64 32}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !18}


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