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

; 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.R3Plane = type { %class.R3Vector, double }
%class.R3Vector = type { [3 x double] }
%class.RNFlags = type { i64 }
%class.R3Triangle = type <{ %class.R3Surface, [3 x ptr], %class.R3Plane, %class.R3Box, %class.RNFlags, i32, [4 x i8] }>
%class.R3Surface = type { %class.R3Shape }

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8), i64) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10R3Triangle6UpdateEv(ptr noundef nonnull align 8 dereferenceable(132) %0) unnamed_addr #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %class.R3Plane, align 8
  %4 = alloca %class.RNFlags, align 8
  %5 = alloca i32, align 4
  %6 = alloca %class.RNFlags, align 8
  %7 = alloca %class.RNFlags, align 8
  %8 = alloca %class.RNFlags, align 8
  %9 = alloca %class.RNFlags, align 8
  %10 = alloca %class.RNFlags, align 8
  %11 = alloca %class.RNFlags, align 8
  %12 = alloca %class.RNFlags, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #5
  %14 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %15 = getelementptr inbounds [3 x ptr], ptr %14, i64 0, i64 0
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %16)
  %18 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %19 = getelementptr inbounds [3 x ptr], ptr %18, i64 0, i64 1
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %20)
  %22 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %23 = getelementptr inbounds [3 x ptr], ptr %22, i64 0, i64 2
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %24)
  call void @_ZN7R3PlaneC1ERK7R3PointS2_S2_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %25)
  %26 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 2
  %27 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull align 8 dereferenceable(32) %3)
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  %28 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 3
  %29 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %28, ptr noundef nonnull align 8 dereferenceable(56) @R3null_box)
  %30 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 3
  %31 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %32 = getelementptr inbounds [3 x ptr], ptr %31, i64 0, i64 0
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %33)
  call void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56) %30, ptr noundef nonnull align 8 dereferenceable(24) %34)
  %35 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 3
  %36 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %37 = getelementptr inbounds [3 x ptr], ptr %36, i64 0, i64 1
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %38)
  call void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56) %35, ptr noundef nonnull align 8 dereferenceable(24) %39)
  %40 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 3
  %41 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %42 = getelementptr inbounds [3 x ptr], ptr %41, i64 0, i64 2
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %43)
  call void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56) %40, ptr noundef nonnull align 8 dereferenceable(24) %44)
  %45 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 4
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 1907)
  %46 = getelementptr inbounds %class.RNFlags, ptr %4, i32 0, i32 0
  %47 = load i64, ptr %46, align 8
  call void @_ZN7RNFlags3AddES_(ptr noundef nonnull align 8 dereferenceable(8) %45, i64 %47)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %87, %1
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = icmp slt i32 %49, 3
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %90

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %53 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %54 = load i32, ptr %5, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [3 x ptr], ptr %53, i64 0, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = call i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %57)
  %59 = getelementptr inbounds %class.RNFlags, ptr %6, i32 0, i32 0
  store i64 %58, ptr %59, align 8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef 256)
  %60 = getelementptr inbounds %class.RNFlags, ptr %7, i32 0, i32 0
  %61 = load i64, ptr %60, align 8
  %62 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 %61)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %68, label %64

64:                                               ; preds = %52
  %65 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 4
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 256)
  %66 = getelementptr inbounds %class.RNFlags, ptr %8, i32 0, i32 0
  %67 = load i64, ptr %66, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %65, i64 %67)
  br label %68

68:                                               ; preds = %64, %52
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 1024)
  %69 = getelementptr inbounds %class.RNFlags, ptr %9, i32 0, i32 0
  %70 = load i64, ptr %69, align 8
  %71 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 %70)
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %77, label %73

73:                                               ; preds = %68
  %74 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 4
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 1024)
  %75 = getelementptr inbounds %class.RNFlags, ptr %10, i32 0, i32 0
  %76 = load i64, ptr %75, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %74, i64 %76)
  br label %77

77:                                               ; preds = %73, %68
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 512)
  %78 = getelementptr inbounds %class.RNFlags, ptr %11, i32 0, i32 0
  %79 = load i64, ptr %78, align 8
  %80 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 %79)
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %86, label %82

82:                                               ; preds = %77
  %83 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 4
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef 512)
  %84 = getelementptr inbounds %class.RNFlags, ptr %12, i32 0, i32 0
  %85 = load i64, ptr %84, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %83, i64 %85)
  br label %86

86:                                               ; preds = %82, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %5, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %5, align 4, !tbaa !9
  br label %48, !llvm.loop !11

90:                                               ; preds = %51
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; 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)) #1 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 nounwind uwtable
declare dso_local void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8), i64) #0 align 2

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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.R3Plane = type { %class.R3Vector, double }
%class.R3Vector = type { [3 x double] }
%class.RNFlags = type { i64 }

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8), i64) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10R3Triangle6UpdateEv(ptr noundef nonnull align 8 dereferenceable(132) %0) unnamed_addr #3 align 2 {
  %2 = alloca %class.R3Plane, align 8
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca %class.RNFlags, align 8
  %5 = alloca %class.RNFlags, align 8
  %6 = alloca %class.RNFlags, align 8
  %7 = alloca %class.RNFlags, align 8
  %8 = alloca %class.RNFlags, align 8
  %9 = alloca %class.RNFlags, align 8
  %10 = alloca %class.RNFlags, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %12)
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %15)
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %18)
  call void @_ZN7R3PlaneC1ERK7R3PointS2_S2_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %19)
  %20 = getelementptr inbounds i8, ptr %0, i64 32
  %21 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %2)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  %22 = getelementptr inbounds i8, ptr %0, i64 64
  %23 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %22, ptr noundef nonnull align 8 dereferenceable(56) @R3null_box)
  %24 = load ptr, ptr %11, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %24)
  call void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56) %22, ptr noundef nonnull align 8 dereferenceable(24) %25)
  %26 = load ptr, ptr %14, align 8, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %26)
  call void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56) %22, ptr noundef nonnull align 8 dereferenceable(24) %27)
  %28 = load ptr, ptr %17, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %28)
  call void @_ZN5R3Box5UnionERK7R3Point(ptr noundef nonnull align 8 dereferenceable(56) %22, ptr noundef nonnull align 8 dereferenceable(24) %29)
  %30 = getelementptr inbounds i8, ptr %0, i64 120
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef 1907)
  %31 = load i64, ptr %3, align 8
  call void @_ZN7RNFlags3AddES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %31)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = call i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %32)
  store i64 %33, ptr %4, align 8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 256)
  %34 = load i64, ptr %5, align 8
  %35 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %34)
  %.not = icmp eq i32 %35, 0
  br i1 %.not, label %36, label %38

36:                                               ; preds = %1
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 256)
  %37 = load i64, ptr %6, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %37)
  br label %38

38:                                               ; preds = %36, %1
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef 1024)
  %39 = load i64, ptr %7, align 8
  %40 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %39)
  %.not3 = icmp eq i32 %40, 0
  br i1 %.not3, label %41, label %43

41:                                               ; preds = %38
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 1024)
  %42 = load i64, ptr %8, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %42)
  br label %43

43:                                               ; preds = %41, %38
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 512)
  %44 = load i64, ptr %9, align 8
  %45 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %44)
  %.not4 = icmp eq i32 %45, 0
  br i1 %.not4, label %46, label %48

46:                                               ; preds = %43
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 512)
  %47 = load i64, ptr %10, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %47)
  br label %48

48:                                               ; preds = %46, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %49 = getelementptr inbounds i8, ptr %0, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = call i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %50)
  store i64 %51, ptr %4, align 8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 256)
  %52 = load i64, ptr %5, align 8
  %53 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %52)
  %.not.1 = icmp eq i32 %53, 0
  br i1 %.not.1, label %54, label %56

54:                                               ; preds = %48
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 256)
  %55 = load i64, ptr %6, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %55)
  br label %56

56:                                               ; preds = %54, %48
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef 1024)
  %57 = load i64, ptr %7, align 8
  %58 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %57)
  %.not3.1 = icmp eq i32 %58, 0
  br i1 %.not3.1, label %59, label %61

59:                                               ; preds = %56
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 1024)
  %60 = load i64, ptr %8, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %60)
  br label %61

61:                                               ; preds = %59, %56
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 512)
  %62 = load i64, ptr %9, align 8
  %63 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %62)
  %.not4.1 = icmp eq i32 %63, 0
  br i1 %.not4.1, label %64, label %66

64:                                               ; preds = %61
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 512)
  %65 = load i64, ptr %10, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %65)
  br label %66

66:                                               ; preds = %64, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %67 = getelementptr inbounds i8, ptr %0, i64 24
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = call i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %68)
  store i64 %69, ptr %4, align 8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 256)
  %70 = load i64, ptr %5, align 8
  %71 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %70)
  %.not.2 = icmp eq i32 %71, 0
  br i1 %.not.2, label %72, label %74

72:                                               ; preds = %66
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 256)
  %73 = load i64, ptr %6, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %73)
  br label %74

74:                                               ; preds = %72, %66
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef 1024)
  %75 = load i64, ptr %7, align 8
  %76 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %75)
  %.not3.2 = icmp eq i32 %76, 0
  br i1 %.not3.2, label %77, label %79

77:                                               ; preds = %74
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 1024)
  %78 = load i64, ptr %8, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %78)
  br label %79

79:                                               ; preds = %77, %74
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 512)
  %80 = load i64, ptr %9, align 8
  %81 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 %80)
  %.not4.2 = icmp eq i32 %81, 0
  br i1 %.not4.2, label %82, label %84

82:                                               ; preds = %79
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 512)
  %83 = load i64, ptr %10, align 8
  call void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 %83)
  br label %84

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; 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 #1 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 nounwind uwtable
declare dso_local void @_ZN7RNFlags6RemoveES_(ptr noundef nonnull align 8 dereferenceable(8), i64) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass