; 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 }
%class.R3MeshVertex = type { ptr, %class.RNArray.0, %class.R3Point, %class.R3Vector, %class.R2Point, %class.RNRgb, double, i32, %class.RNFlags, double, i32, ptr }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.RNRgb = type { [3 x double] }
%class.RNFlags = type { i64 }

@R3mesh_mark = external dso_local global i32, align 4
@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
@_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap = external hidden global %class.RNHeap.7, align 8
@_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap = 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 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: mustprogress uwtable
declare dso_local noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 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 #5 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) #5 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)) #5 align 2

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

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

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

40:                                               ; preds = %5
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.44) #8
  store ptr null, ptr %6, align 8
  store i32 1, ptr %13, align 4
  br label %231

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

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

58:                                               ; preds = %53
  call void @_ZdaPv(ptr noundef %56) #12
  br label %59

59:                                               ; preds = %58, %53
  store ptr null, ptr %6, align 8
  store i32 1, ptr %13, align 4
  br label %230

60:                                               ; preds = %43
  %61 = load i32, ptr @R3mesh_mark, align 4, !tbaa !11
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr @R3mesh_mark, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #8
  %63 = load atomic i8, ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap acquire, align 8
  %64 = icmp eq i8 %63, 0
  br i1 %64, label %65, label %73, !prof !13

65:                                               ; preds = %60
  %66 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap) #8
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %73

68:                                               ; preds = %65
  %69 = getelementptr inbounds %struct.DijkstraData, ptr %15, i32 0, i32 4
  %70 = getelementptr inbounds %struct.DijkstraData, ptr %15, i32 0, i32 3
  invoke void @_ZN6RNHeapIP12DijkstraDataEC2ES1_PdPPS1_i(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr noundef %15, ptr noundef %69, ptr noundef %70, i32 noundef 1)
          to label %71 unwind label %80

71:                                               ; preds = %68
  %72 = call i32 @__cxa_atexit(ptr @_ZN6RNHeapIP12DijkstraDataED2Ev, ptr @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr @__dso_handle) #8
  call void @__cxa_guard_release(ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap) #8
  br label %73

73:                                               ; preds = %71, %65, %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %74

74:                                               ; preds = %108, %73
  %75 = load i32, ptr %18, align 4, !tbaa !11
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %76)
  %78 = icmp slt i32 %75, %77
  br i1 %78, label %84, label %79

79:                                               ; preds = %74
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %111

80:                                               ; preds = %68
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %16, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %17, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %233

84:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = load i32, ptr %18, align 4, !tbaa !11
  %87 = call noundef ptr @_ZNK7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %85, i32 noundef %86)
  store ptr %87, ptr %19, align 8, !tbaa !5
  %88 = load i32, ptr @R3mesh_mark, align 4, !tbaa !11
  %89 = load ptr, ptr %19, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.R3MeshVertex, ptr %89, i32 0, i32 10
  store i32 %88, ptr %90, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = load ptr, ptr %19, align 8, !tbaa !5
  %93 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %92)
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds %struct.DijkstraData, ptr %91, i64 %94
  store ptr %95, ptr %20, align 8, !tbaa !5
  %96 = load ptr, ptr %19, align 8, !tbaa !5
  %97 = load ptr, ptr %20, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.DijkstraData, ptr %97, i32 0, i32 0
  store ptr %96, ptr %98, align 8, !tbaa !24
  %99 = load ptr, ptr %20, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.DijkstraData, ptr %99, i32 0, i32 1
  store ptr null, ptr %100, align 8, !tbaa !26
  %101 = load ptr, ptr %20, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.DijkstraData, ptr %101, i32 0, i32 2
  store double 0.000000e+00, ptr %102, align 8, !tbaa !27
  %103 = load ptr, ptr %20, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.DijkstraData, ptr %103, i32 0, i32 3
  store ptr null, ptr %104, align 8, !tbaa !28
  %105 = load ptr, ptr %20, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.DijkstraData, ptr %105, i32 0, i32 4
  store double 0.000000e+00, ptr %106, align 8, !tbaa !29
  %107 = load ptr, ptr %20, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr noundef %107)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %108

108:                                              ; preds = %84
  %109 = load i32, ptr %18, align 4, !tbaa !11
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %18, align 4, !tbaa !11
  br label %74, !llvm.loop !30

111:                                              ; preds = %79
  br label %112

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

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %117 = call noundef ptr @_ZN6RNHeapIP12DijkstraDataE3PopEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap)
  store ptr %117, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %118 = load ptr, ptr %21, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.DijkstraData, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !24
  store ptr %120, ptr %22, align 8, !tbaa !5
  %121 = load double, ptr %9, align 8, !tbaa !9
  %122 = fcmp ogt double %121, 0.000000e+00
  br i1 %122, label %123, label %130

123:                                              ; preds = %116
  %124 = load ptr, ptr %21, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.DijkstraData, ptr %124, i32 0, i32 4
  %126 = load double, ptr %125, align 8, !tbaa !29
  %127 = load double, ptr %9, align 8, !tbaa !9
  %128 = fcmp ogt double %126, %127
  br i1 %128, label %129, label %130

129:                                              ; preds = %123
  store i32 6, ptr %13, align 4
  br label %221

130:                                              ; preds = %123, %116
  %131 = load ptr, ptr %10, align 8, !tbaa !5
  %132 = load ptr, ptr %22, align 8, !tbaa !5
  %133 = call noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %131, ptr noundef %132)
  %134 = load ptr, ptr %21, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.DijkstraData, ptr %134, i32 0, i32 4
  %136 = load double, ptr %135, align 8, !tbaa !29
  %137 = load ptr, ptr %12, align 8, !tbaa !5
  %138 = load ptr, ptr %22, align 8, !tbaa !5
  %139 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %138)
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds double, ptr %137, i64 %140
  store double %136, ptr %141, align 8, !tbaa !9
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %153

144:                                              ; preds = %130
  %145 = load ptr, ptr %21, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.DijkstraData, ptr %145, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8, !tbaa !26
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = load ptr, ptr %22, align 8, !tbaa !5
  %150 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %149)
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds ptr, ptr %148, i64 %151
  store ptr %147, ptr %152, align 8, !tbaa !5
  br label %153

153:                                              ; preds = %144, %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %154

154:                                              ; preds = %217, %153
  %155 = load i32, ptr %23, align 4, !tbaa !11
  %156 = load ptr, ptr %22, align 8, !tbaa !5
  %157 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %156)
  %158 = icmp slt i32 %155, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %154
  store i32 7, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %220

160:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %161 = load ptr, ptr %22, align 8, !tbaa !5
  %162 = load i32, ptr %23, align 4, !tbaa !11
  %163 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %161, i32 noundef %162)
  store ptr %163, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %164 = load ptr, ptr %24, align 8, !tbaa !5
  %165 = load ptr, ptr %22, align 8, !tbaa !5
  %166 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %164, ptr noundef %165)
  store ptr %166, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %167 = load ptr, ptr %14, align 8, !tbaa !5
  %168 = load ptr, ptr %25, align 8, !tbaa !5
  %169 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %168)
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %struct.DijkstraData, ptr %167, i64 %170
  store ptr %171, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %172 = load ptr, ptr %24, align 8, !tbaa !5
  %173 = call noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %172)
  %174 = load ptr, ptr %21, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.DijkstraData, ptr %174, i32 0, i32 4
  %176 = load double, ptr %175, align 8, !tbaa !29
  %177 = fadd double %173, %176
  store double %177, ptr %27, align 8, !tbaa !9
  %178 = load ptr, ptr %25, align 8, !tbaa !5
  %179 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %178)
  %180 = load i32, ptr @R3mesh_mark, align 4, !tbaa !11
  %181 = icmp ne i32 %179, %180
  br i1 %181, label %182, label %200

182:                                              ; preds = %160
  %183 = load i32, ptr @R3mesh_mark, align 4, !tbaa !11
  %184 = load ptr, ptr %25, align 8, !tbaa !5
  %185 = getelementptr inbounds %class.R3MeshVertex, ptr %184, i32 0, i32 10
  store i32 %183, ptr %185, align 8, !tbaa !14
  %186 = load ptr, ptr %25, align 8, !tbaa !5
  %187 = load ptr, ptr %26, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.DijkstraData, ptr %187, i32 0, i32 0
  store ptr %186, ptr %188, align 8, !tbaa !24
  %189 = load ptr, ptr %24, align 8, !tbaa !5
  %190 = load ptr, ptr %26, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.DijkstraData, ptr %190, i32 0, i32 1
  store ptr %189, ptr %191, align 8, !tbaa !26
  %192 = load ptr, ptr %26, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.DijkstraData, ptr %192, i32 0, i32 2
  store double -1.000000e+00, ptr %193, align 8, !tbaa !27
  %194 = load ptr, ptr %26, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.DijkstraData, ptr %194, i32 0, i32 3
  store ptr null, ptr %195, align 8, !tbaa !28
  %196 = load double, ptr %27, align 8, !tbaa !9
  %197 = load ptr, ptr %26, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.DijkstraData, ptr %197, i32 0, i32 4
  store double %196, ptr %198, align 8, !tbaa !29
  %199 = load ptr, ptr %26, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr noundef %199)
  br label %216

200:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %201 = load ptr, ptr %26, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.DijkstraData, ptr %201, i32 0, i32 4
  %203 = load double, ptr %202, align 8, !tbaa !29
  store double %203, ptr %28, align 8, !tbaa !9
  %204 = load double, ptr %27, align 8, !tbaa !9
  %205 = load double, ptr %28, align 8, !tbaa !9
  %206 = fcmp olt double %204, %205
  br i1 %206, label %207, label %215

207:                                              ; preds = %200
  %208 = load ptr, ptr %24, align 8, !tbaa !5
  %209 = load ptr, ptr %26, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.DijkstraData, ptr %209, i32 0, i32 1
  store ptr %208, ptr %210, align 8, !tbaa !26
  %211 = load double, ptr %27, align 8, !tbaa !9
  %212 = load ptr, ptr %26, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.DijkstraData, ptr %212, i32 0, i32 4
  store double %211, ptr %213, align 8, !tbaa !29
  %214 = load ptr, ptr %26, align 8, !tbaa !5
  call void @_ZN6RNHeapIP12DijkstraDataE6UpdateES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr noundef %214)
  br label %215

215:                                              ; preds = %207, %200
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %216

216:                                              ; preds = %215, %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
  br label %217

217:                                              ; preds = %216
  %218 = load i32, ptr %23, align 4, !tbaa !11
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %23, align 4, !tbaa !11
  br label %154, !llvm.loop !32

220:                                              ; preds = %159
  store i32 0, ptr %13, align 4
  br label %221

221:                                              ; preds = %220, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  %222 = load i32, ptr %13, align 4
  switch i32 %222, label %238 [
    i32 0, label %223
    i32 6, label %224
  ]

223:                                              ; preds = %221
  br label %112, !llvm.loop !33

224:                                              ; preds = %221, %112
  call void @_ZN6RNHeapIP12DijkstraDataE5EmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap)
  %225 = load ptr, ptr %14, align 8, !tbaa !5
  %226 = icmp eq ptr %225, null
  br i1 %226, label %228, label %227

227:                                              ; preds = %224
  call void @_ZdaPv(ptr noundef %225) #12
  br label %228

228:                                              ; preds = %227, %224
  %229 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %229, ptr %6, align 8
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #8
  br label %230

230:                                              ; preds = %228, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %231

231:                                              ; preds = %230, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %232 = load ptr, ptr %6, align 8
  ret ptr %232

233:                                              ; preds = %80
  %234 = load ptr, ptr %16, align 8
  %235 = load i32, ptr %17, align 4
  %236 = insertvalue { ptr, i32 } poison, ptr %234, 0
  %237 = insertvalue { ptr, i32 } %236, i32 %235, 1
  resume { ptr, i32 } %237

238:                                              ; preds = %221
  unreachable
}

declare void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #10

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 = { 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 #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 = { 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 = { "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 = !{!"branch_weights", i32 1, i32 1048575}
!14 = !{!15, !12, i64 144}
!15 = !{!"_ZTS12R3MeshVertex", !16, i64 8, !18, i64 24, !19, i64 48, !20, i64 72, !21, i64 88, !10, i64 112, !12, i64 120, !22, i64 128, !10, i64 136, !12, i64 144, !6, i64 152}
!16 = !{!"_ZTS7RNArrayIP10R3MeshEdgeE", !17, i64 0}
!17 = !{!"_ZTS8RNVArray", !6, i64 0, !12, i64 8, !12, i64 12}
!18 = !{!"_ZTS7R3Point", !7, i64 0}
!19 = !{!"_ZTS8R3Vector", !7, i64 0}
!20 = !{!"_ZTS7R2Point", !7, i64 0}
!21 = !{!"_ZTS5RNRgb", !7, i64 0}
!22 = !{!"_ZTS7RNFlags", !23, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTS12DijkstraData", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32}
!26 = !{!25, !6, i64 8}
!27 = !{!25, !10, i64 16}
!28 = !{!25, !6, i64 24}
!29 = !{!25, !10, i64 32}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = distinct !{!33, !31}


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

@R3mesh_mark = external dso_local local_unnamed_addr global i32, align 4
@__dso_handle = external hidden global i8
@_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap = external hidden global %class.RNHeap.7, align 8
@_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap = 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 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: mustprogress uwtable
declare dso_local noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #5 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 #5 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 #5 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 #5 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noalias noundef nonnull ptr @_ZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef writeonly %4) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %struct.DijkstraData, align 8
  tail call void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef 0)
  %7 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %8 = zext nneg i32 %7 to i64
  %9 = icmp slt i32 %7, 0
  %10 = shl nuw nsw i64 %8, 3
  %11 = select i1 %9, i64 -1, i64 %10
  %12 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #11
  %13 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %14 = sext i32 %13 to i64
  %15 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %14, i64 40)
  %16 = extractvalue { i64, i1 } %15, 1
  %17 = extractvalue { i64, i1 } %15, 0
  %18 = select i1 %16, i64 -1, i64 %17
  %19 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #11
  %20 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @R3mesh_mark, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #12
  %22 = load atomic i8, ptr @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap acquire, align 8
  %23 = icmp eq i8 %22, 0
  br i1 %23, label %24, label %31, !prof !9

24:                                               ; preds = %5
  %25 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap) #12
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %31, label %26

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %6, i64 32
  %28 = getelementptr inbounds i8, ptr %6, i64 24
  invoke void @_ZN6RNHeapIP12DijkstraDataEC2ES1_PdPPS1_i(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr noundef nonnull %6, ptr noundef nonnull %27, ptr noundef nonnull %28, i32 noundef 1)
          to label %29 unwind label %36

29:                                               ; preds = %26
  %30 = call i32 @__cxa_atexit(ptr nonnull @_ZN6RNHeapIP12DijkstraDataED2Ev, ptr nonnull @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr nonnull @__dso_handle) #12
  call void @__cxa_guard_release(ptr nonnull @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap) #12
  br label %31

31:                                               ; preds = %29, %24, %5
  %32 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %31
  %34 = call noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap)
  %.not7583 = icmp eq i32 %34, 0
  br i1 %.not7583, label %.lr.ph84, label %.thread

.lr.ph84:                                         ; preds = %.preheader
  %35 = fcmp ogt double %2, 0.000000e+00
  %.not76 = icmp eq ptr %4, null
  br label %49

36:                                               ; preds = %26
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap) #12
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #12
  resume { ptr, i32 } %37

.lr.ph:                                           ; preds = %31, %.lr.ph
  %.06980 = phi i32 [ %45, %.lr.ph ], [ 0, %31 ]
  %38 = call noundef ptr @_ZNK7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.06980)
  %39 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %38, i64 144
  store i32 %39, ptr %40, align 8, !tbaa !10
  %41 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %38)
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct.DijkstraData, ptr %19, i64 %42
  store ptr %38, ptr %43, align 8, !tbaa !22
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %44, i8 0, i64 32, i1 false)
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr noundef nonnull %43)
  %45 = add nuw nsw i32 %.06980, 1
  %46 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph, label %.preheader, !llvm.loop !24

.loopexit:                                        ; preds = %94, %69
  %48 = call noundef i32 @_ZNK6RNHeapIP12DijkstraDataE7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap)
  %.not75 = icmp eq i32 %48, 0
  br i1 %.not75, label %49, label %.thread

49:                                               ; preds = %.lr.ph84, %.loopexit
  %50 = call noundef ptr @_ZN6RNHeapIP12DijkstraDataE3PopEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap)
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  br i1 %35, label %52, label %56

52:                                               ; preds = %49
  %53 = getelementptr inbounds i8, ptr %50, i64 32
  %54 = load double, ptr %53, align 8, !tbaa !26
  %55 = fcmp ogt double %54, %2
  br i1 %55, label %.thread, label %56

56:                                               ; preds = %52, %49
  %57 = call noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef %51)
  %58 = getelementptr inbounds i8, ptr %50, i64 32
  %59 = load double, ptr %58, align 8, !tbaa !26
  %60 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %51)
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds double, ptr %12, i64 %61
  store double %59, ptr %62, align 8, !tbaa !27
  br i1 %.not76, label %69, label %63

63:                                               ; preds = %56
  %64 = getelementptr inbounds i8, ptr %50, i64 8
  %65 = load ptr, ptr %64, align 8, !tbaa !28
  %66 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %51)
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds ptr, ptr %4, i64 %67
  store ptr %65, ptr %68, align 8, !tbaa !29
  br label %69

69:                                               ; preds = %63, %56
  %70 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %51)
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph82, label %.loopexit

.lr.ph82:                                         ; preds = %69, %94
  %.07081 = phi i32 [ %95, %94 ], [ 0, %69 ]
  %72 = call noundef ptr @_ZNK6R3Mesh12EdgeOnVertexEPK12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %51, i32 noundef %.07081)
  %73 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %72, ptr noundef %51)
  %74 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %73)
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.DijkstraData, ptr %19, i64 %75
  %77 = call noundef double @_ZNK6R3Mesh10EdgeLengthEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %72)
  %78 = load double, ptr %58, align 8, !tbaa !26
  %79 = fadd double %77, %78
  %80 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %73)
  %81 = load i32, ptr @R3mesh_mark, align 4, !tbaa !5
  %.not77 = icmp eq i32 %80, %81
  br i1 %.not77, label %88, label %82

82:                                               ; preds = %.lr.ph82
  %83 = getelementptr inbounds i8, ptr %73, i64 144
  store i32 %81, ptr %83, align 8, !tbaa !10
  store ptr %73, ptr %76, align 8, !tbaa !22
  %84 = getelementptr inbounds i8, ptr %76, i64 8
  store ptr %72, ptr %84, align 8, !tbaa !28
  %85 = getelementptr inbounds i8, ptr %76, i64 16
  store double -1.000000e+00, ptr %85, align 8, !tbaa !30
  %86 = getelementptr inbounds i8, ptr %76, i64 24
  store ptr null, ptr %86, align 8, !tbaa !31
  %87 = getelementptr inbounds i8, ptr %76, i64 32
  store double %79, ptr %87, align 8, !tbaa !26
  call void @_ZN6RNHeapIP12DijkstraDataE4PushES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr noundef nonnull %76)
  br label %94

88:                                               ; preds = %.lr.ph82
  %89 = getelementptr inbounds i8, ptr %76, i64 32
  %90 = load double, ptr %89, align 8, !tbaa !26
  %91 = fcmp olt double %79, %90
  br i1 %91, label %92, label %94

92:                                               ; preds = %88
  %93 = getelementptr inbounds i8, ptr %76, i64 8
  store ptr %72, ptr %93, align 8, !tbaa !28
  store double %79, ptr %89, align 8, !tbaa !26
  call void @_ZN6RNHeapIP12DijkstraDataE6UpdateES1_(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap, ptr noundef nonnull %76)
  br label %94

94:                                               ; preds = %88, %92, %82
  %95 = add nuw nsw i32 %.07081, 1
  %96 = call noundef i32 @_ZNK6R3Mesh13VertexValenceEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %51)
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %.lr.ph82, label %.loopexit, !llvm.loop !32

.thread:                                          ; preds = %.loopexit, %52, %.preheader
  call void @_ZN6RNHeapIP12DijkstraDataE5EmptyEv(ptr noundef nonnull align 8 dereferenceable(52) @_ZZNK6R3Mesh17DijkstraDistancesERK7RNArrayIP12R3MeshVertexEdRS3_PP10R3MeshEdgeE4heap)
  call void @_ZdaPv(ptr noundef nonnull %19) #13
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #12
  ret ptr %12
}

declare void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #9

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

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 = { 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 #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 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { nounwind }
attributes #13 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !6, i64 144}
!11 = !{!"_ZTS12R3MeshVertex", !12, i64 8, !15, i64 24, !16, i64 48, !17, i64 72, !18, i64 88, !19, i64 112, !6, i64 120, !20, i64 128, !19, i64 136, !6, i64 144, !14, i64 152}
!12 = !{!"_ZTS7RNArrayIP10R3MeshEdgeE", !13, i64 0}
!13 = !{!"_ZTS8RNVArray", !14, i64 0, !6, i64 8, !6, i64 12}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"_ZTS7R3Point", !7, i64 0}
!16 = !{!"_ZTS8R3Vector", !7, i64 0}
!17 = !{!"_ZTS7R2Point", !7, i64 0}
!18 = !{!"_ZTS5RNRgb", !7, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = !{!"_ZTS7RNFlags", !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!23, !14, i64 0}
!23 = !{!"_ZTS12DijkstraData", !14, i64 0, !14, i64 8, !19, i64 16, !14, i64 24, !19, i64 32}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!23, !19, i64 32}
!27 = !{!19, !19, i64 0}
!28 = !{!23, !14, i64 8}
!29 = !{!14, !14, i64 0}
!30 = !{!23, !19, i64 16}
!31 = !{!23, !14, i64 24}
!32 = distinct !{!32, !25}


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