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

; 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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.RNFlags = type { i64 }
%class.R3Mesh = type { ptr, %class.RNArray, %class.RNArray.0, %class.RNArray.1, ptr, ptr, ptr, [128 x i8], %class.R3Box, ptr }
%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNArray.1 = type { %class.RNVArray }
%class.R3MeshVertex = type { ptr, %class.RNArray.0, %class.R3Point, %class.R3Vector, %class.R2Point, %class.RNRgb, double, i32, %class.RNFlags, double, i32, ptr }
%class.R2Point = type { [2 x double] }
%class.RNRgb = type { [3 x double] }
%class.R3MeshEdge = type { ptr, [2 x ptr], [2 x ptr], double, i32, %class.RNFlags, double, i32, ptr }
%class.R3MeshFace = type { ptr, [3 x ptr], [3 x ptr], %class.R3Plane, %class.R3Box, double, i32, i32, i32, i32, %class.RNFlags, double, i32, ptr }
%class.R3Plane = type { %class.R3Vector, double }

@R3null_box = external global %class.R3Box, align 8

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK8R3Vector(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 2

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

declare void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh14AddRandomNoiseEd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca %class.R3Vector, align 8
  %9 = alloca %class.R3Vector, align 8
  %10 = alloca %class.RNFlags, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %class.RNFlags, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %class.RNFlags, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %17 = load ptr, ptr %3, align 8
  %18 = getelementptr inbounds %class.R3Mesh, ptr %17, i32 0, i32 8
  %19 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %18, ptr noundef nonnull align 8 dereferenceable(56) @R3null_box)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %20

20:                                               ; preds = %46, %2
  %21 = load i32, ptr %5, align 4, !tbaa !11
  %22 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %17)
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %49

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %26 = load i32, ptr %5, align 4, !tbaa !11
  %27 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %17, i32 noundef %26)
  store ptr %27, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %28 = load double, ptr %4, align 8, !tbaa !9
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call noundef double @_ZNK6R3Mesh23VertexAverageEdgeLengthEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %17, ptr noundef %29)
  %31 = fmul double %28, %30
  store double %31, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  %32 = call noundef double @_Z14RNRandomScalarv()
  %33 = call noundef double @_Z14RNRandomScalarv()
  %34 = call noundef double @_Z14RNRandomScalarv()
  call void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %8, double noundef %32, double noundef %33, double noundef %34)
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %35 = load double, ptr %7, align 8, !tbaa !9
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %9, double noundef %35, ptr noundef nonnull align 8 dereferenceable(24) %8)
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.R3MeshVertex, ptr %36, i32 0, i32 2
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %class.R3MeshVertex, ptr %39, i32 0, i32 8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 2)
  %41 = getelementptr inbounds %class.RNFlags, ptr %10, i32 0, i32 0
  %42 = load i64, ptr %41, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %40, i64 %42)
  %43 = getelementptr inbounds %class.R3Mesh, ptr %17, i32 0, i32 8
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.R3MeshVertex, ptr %44, i32 0, i32 2
  call void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56) %43, ptr noundef nonnull align 8 dereferenceable(24) %45)
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %46

46:                                               ; preds = %25
  %47 = load i32, ptr %5, align 4, !tbaa !11
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %5, align 4, !tbaa !11
  br label %20, !llvm.loop !13

49:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %62, %49
  %51 = load i32, ptr %11, align 4, !tbaa !11
  %52 = call noundef i32 @_ZNK6R3Mesh6NEdgesEv(ptr noundef nonnull align 8 dereferenceable(272) %17)
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %65

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %56 = load i32, ptr %11, align 4, !tbaa !11
  %57 = call noundef ptr @_ZNK6R3Mesh4EdgeEi(ptr noundef nonnull align 8 dereferenceable(272) %17, i32 noundef %56)
  store ptr %57, ptr %12, align 8, !tbaa !5
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.R3MeshEdge, ptr %58, i32 0, i32 5
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %13, i64 noundef 2)
  %60 = getelementptr inbounds %class.RNFlags, ptr %13, i32 0, i32 0
  %61 = load i64, ptr %60, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %59, i64 %61)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %62

62:                                               ; preds = %55
  %63 = load i32, ptr %11, align 4, !tbaa !11
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %11, align 4, !tbaa !11
  br label %50, !llvm.loop !15

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

66:                                               ; preds = %78, %65
  %67 = load i32, ptr %14, align 4, !tbaa !11
  %68 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %17)
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %81

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %72 = load i32, ptr %14, align 4, !tbaa !11
  %73 = call noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %17, i32 noundef %72)
  store ptr %73, ptr %15, align 8, !tbaa !5
  %74 = load ptr, ptr %15, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.R3MeshFace, ptr %74, i32 0, i32 10
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef 12)
  %76 = getelementptr inbounds %class.RNFlags, ptr %16, i32 0, i32 0
  %77 = load i64, ptr %76, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %75, i64 %77)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %78

78:                                               ; preds = %71
  %79 = load i32, ptr %14, align 4, !tbaa !11
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %14, align 4, !tbaa !11
  br label %66, !llvm.loop !16

81:                                               ; preds = %70
  ret void
}

declare noundef double @_Z14RNRandomScalarv() #4

declare void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4

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 willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.RNFlags = type { i64 }

@R3null_box = external global %class.R3Box, align 8

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK8R3Vector(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 2

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

declare void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh14AddRandomNoiseEd(ptr noundef nonnull align 8 dereferenceable(272) %0, double noundef %1) unnamed_addr #2 align 2 {
  %3 = alloca %class.R3Vector, align 8
  %4 = alloca %class.R3Vector, align 8
  %5 = alloca %class.RNFlags, align 8
  %6 = alloca %class.RNFlags, align 8
  %7 = alloca %class.RNFlags, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 208
  %9 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 8 dereferenceable(56) @R3null_box)
  %10 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader19

.preheader19:                                     ; preds = %.lr.ph, %2
  %12 = call noundef i32 @_ZNK6R3Mesh6NEdgesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph22, label %.preheader

.lr.ph:                                           ; preds = %2, %.lr.ph
  %.020 = phi i32 [ %24, %.lr.ph ], [ 0, %2 ]
  %14 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %.020)
  %15 = call noundef double @_ZNK6R3Mesh23VertexAverageEdgeLengthEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %14)
  %16 = fmul double %15, %1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %17 = call noundef double @_Z14RNRandomScalarv()
  %18 = call noundef double @_Z14RNRandomScalarv()
  %19 = call noundef double @_Z14RNRandomScalarv()
  call void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %3, double noundef %17, double noundef %18, double noundef %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %4, double noundef %16, ptr noundef nonnull align 8 dereferenceable(24) %3)
  %20 = getelementptr inbounds i8, ptr %14, i64 24
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  %22 = getelementptr inbounds i8, ptr %14, i64 128
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 2)
  %23 = load i64, ptr %5, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %22, i64 %23)
  call void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  %24 = add nuw nsw i32 %.020, 1
  %25 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %.lr.ph, label %.preheader19, !llvm.loop !5

.preheader:                                       ; preds = %.lr.ph22, %.preheader19
  %27 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph24, label %._crit_edge

.lr.ph22:                                         ; preds = %.preheader19, %.lr.ph22
  %.01821 = phi i32 [ %32, %.lr.ph22 ], [ 0, %.preheader19 ]
  %29 = call noundef ptr @_ZNK6R3Mesh4EdgeEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %.01821)
  %30 = getelementptr inbounds i8, ptr %29, i64 56
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 2)
  %31 = load i64, ptr %6, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %31)
  %32 = add nuw nsw i32 %.01821, 1
  %33 = call noundef i32 @_ZNK6R3Mesh6NEdgesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %.lr.ph22, label %.preheader, !llvm.loop !7

._crit_edge:                                      ; preds = %.lr.ph24, %.preheader
  ret void

.lr.ph24:                                         ; preds = %.preheader, %.lr.ph24
  %.01723 = phi i32 [ %38, %.lr.ph24 ], [ 0, %.preheader ]
  %35 = call noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %.01723)
  %36 = getelementptr inbounds i8, ptr %35, i64 168
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef 12)
  %37 = load i64, ptr %7, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %36, i64 %37)
  %38 = add nuw nsw i32 %.01723, 1
  %39 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %.lr.ph24, label %._crit_edge, !llvm.loop !8
}

declare noundef double @_Z14RNRandomScalarv() local_unnamed_addr #4

declare void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

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 willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass