; LLVM IR from Eydcao/Yan-CG-SnowSim :: src (BVH)

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

%struct.Intersection = type { i8, %"class.Eigen::Matrix", %"class.Eigen::Matrix", double, ptr }
%"class.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { %"struct.Eigen::internal::plain_array" }
%"struct.Eigen::internal::plain_array" = type { [3 x float] }
%struct.Ray = type { %"class.Eigen::Matrix", %"class.Eigen::Matrix", %"class.Eigen::Matrix", double, double, double }
%"struct.std::array" = type { [3 x i32] }
%struct.BVHBuildNode = type { %class.Bounds3, ptr, ptr, ptr, float, i32, i32, i32 }
%class.Bounds3 = type { %"class.Eigen::Matrix", %"class.Eigen::Matrix" }

@.str.4 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE = external hidden unnamed_addr constant [97 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(64) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #2 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.Intersection, align 8
  %11 = alloca %struct.Ray, align 8
  %12 = alloca %"class.Eigen::Matrix", align 4
  %13 = alloca %"class.Eigen::Matrix", align 4
  %14 = alloca %"struct.std::array", align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %15 = load ptr, ptr %6, align 8
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.BVHBuildNode, ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = icmp ne ptr %18, null
  br i1 %19, label %50, label %20

20:                                               ; preds = %4
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.BVHBuildNode, ptr %21, i32 0, i32 2
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = icmp ne ptr %23, null
  br i1 %24, label %50, label %25

25:                                               ; preds = %20
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.BVHBuildNode, ptr %26, i32 0, i32 3
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  br label %33

31:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 158, ptr noundef @__PRETTY_FUNCTION__._ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE) #5
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #6
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.BVHBuildNode, ptr %34, i32 0, i32 3
  %36 = load ptr, ptr %35, align 8, !tbaa !19
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3RayC2ERKS_(ptr noundef nonnull align 8 dereferenceable(64) %11, ptr noundef nonnull align 8 dereferenceable(64) %37)
  %38 = load ptr, ptr %36, align 8, !tbaa !20
  %39 = getelementptr inbounds ptr, ptr %38, i64 5
  %40 = load ptr, ptr %39, align 8
  call void %40(ptr dead_on_unwind writable sret(%struct.Intersection) align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef %11)
  %41 = getelementptr inbounds %struct.Intersection, ptr %10, i32 0, i32 0
  %42 = load i8, ptr %41, align 8, !tbaa !22, !range !26, !noundef !27
  %43 = trunc i8 %42 to i1
  br i1 %43, label %44, label %46

44:                                               ; preds = %33
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNSt6vectorI12IntersectionSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 8 dereferenceable(48) %10)
  br label %46

46:                                               ; preds = %44, %33
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = call noundef i64 @_ZNKSt6vectorI12IntersectionSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #6
  %49 = trunc i64 %48 to i32
  store i32 %49, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #6
  br label %101

50:                                               ; preds = %20, %4
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #6
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.Ray, ptr %51, i32 0, i32 1
  call void @_ZN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %52)
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #6
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Ray, ptr %53, i32 0, i32 2
  call void @_ZN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %54)
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #6
  %55 = getelementptr inbounds %"struct.std::array", ptr %14, i32 0, i32 0
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1xEv(ptr noundef nonnull align 1 dereferenceable(1) %12)
  %57 = load float, ptr %56, align 4, !tbaa !28
  %58 = fcmp ogt float %57, 0.000000e+00
  %59 = zext i1 %58 to i32
  store i32 %59, ptr %55, align 4, !tbaa !29
  %60 = getelementptr inbounds i32, ptr %55, i64 1
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1yEv(ptr noundef nonnull align 1 dereferenceable(1) %12)
  %62 = load float, ptr %61, align 4, !tbaa !28
  %63 = fcmp ogt float %62, 0.000000e+00
  %64 = zext i1 %63 to i32
  store i32 %64, ptr %60, align 4, !tbaa !29
  %65 = getelementptr inbounds i32, ptr %55, i64 2
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1zEv(ptr noundef nonnull align 1 dereferenceable(1) %12)
  %67 = load float, ptr %66, align 4, !tbaa !28
  %68 = fcmp ogt float %67, 0.000000e+00
  %69 = zext i1 %68 to i32
  store i32 %69, ptr %65, align 4, !tbaa !29
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.BVHBuildNode, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.BVHBuildNode, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = call noundef zeroext i1 @_ZNK7Bounds310IntersectPERK3RayRKN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEERKSt5arrayIiLm3EE(ptr noundef nonnull align 4 dereferenceable(24) %73, ptr noundef nonnull align 8 dereferenceable(64) %74, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %14)
  br i1 %75, label %76, label %83

76:                                               ; preds = %50
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.BVHBuildNode, ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = call noundef i32 @_ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE(ptr noundef nonnull align 8 dereferenceable(40) %15, ptr noundef %79, ptr noundef nonnull align 8 dereferenceable(64) %80, ptr noundef nonnull align 8 dereferenceable(24) %81)
  br label %83

83:                                               ; preds = %76, %50
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.BVHBuildNode, ptr %84, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !18
  %87 = getelementptr inbounds %struct.BVHBuildNode, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = call noundef zeroext i1 @_ZNK7Bounds310IntersectPERK3RayRKN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEERKSt5arrayIiLm3EE(ptr noundef nonnull align 4 dereferenceable(24) %87, ptr noundef nonnull align 8 dereferenceable(64) %88, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %14)
  br i1 %89, label %90, label %97

90:                                               ; preds = %83
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.BVHBuildNode, ptr %91, i32 0, i32 2
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = call noundef i32 @_ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE(ptr noundef nonnull align 8 dereferenceable(40) %15, ptr noundef %93, ptr noundef nonnull align 8 dereferenceable(64) %94, ptr noundef nonnull align 8 dereferenceable(24) %95)
  br label %97

97:                                               ; preds = %90, %83
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = call noundef i64 @_ZNKSt6vectorI12IntersectionSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #6
  %100 = trunc i64 %99 to i32
  store i32 %100, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #6
  br label %101

101:                                              ; preds = %97, %46
  %102 = load i32, ptr %5, align 4
  ret i32 %102
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI12IntersectionSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3RayC2ERKS_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1xEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1yEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1zEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7Bounds310IntersectPERK3RayRKN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEERKSt5arrayIiLm3EE(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI12IntersectionSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #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 = { 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 = { 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 #5 = { noreturn nounwind }
attributes #6 = { 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, !6, i64 24}
!10 = !{!"_ZTS12BVHBuildNode", !11, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !16, i64 48, !17, i64 52, !17, i64 56, !17, i64 60}
!11 = !{!"_ZTS7Bounds3", !12, i64 0, !12, i64 12}
!12 = !{!"_ZTSN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEE", !13, i64 0}
!13 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEEEE", !14, i64 0}
!14 = !{!"_ZTSN5Eigen12DenseStorageIfLi3ELi3ELi1ELi0EEE", !15, i64 0}
!15 = !{!"_ZTSN5Eigen8internal11plain_arrayIfLi3ELi0ELi0EEE", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!10, !6, i64 32}
!19 = !{!10, !6, i64 40}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !8, i64 0}
!22 = !{!23, !24, i64 0}
!23 = !{!"_ZTS12Intersection", !24, i64 0, !12, i64 4, !12, i64 16, !25, i64 32, !6, i64 40}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!16, !16, i64 0}
!29 = !{!17, !17, i64 0}


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

%struct.Intersection = type { i8, %"class.Eigen::Matrix", %"class.Eigen::Matrix", double, ptr }
%"class.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { %"struct.Eigen::internal::plain_array" }
%"struct.Eigen::internal::plain_array" = type { [3 x float] }
%struct.Ray = type { %"class.Eigen::Matrix", %"class.Eigen::Matrix", %"class.Eigen::Matrix", double, double, double }
%"struct.std::array" = type { [3 x i32] }

@.str.4 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE = external hidden unnamed_addr constant [97 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr nocapture noundef readonly %1, ptr noundef nonnull align 8 dereferenceable(64) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %struct.Intersection, align 8
  %6 = alloca %struct.Ray, align 8
  %7 = alloca %"class.Eigen::Matrix", align 4
  %8 = alloca %"class.Eigen::Matrix", align 4
  %9 = alloca %"struct.std::array", align 4
  %10 = getelementptr inbounds i8, ptr %1, i64 24
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %12, label %28

12:                                               ; preds = %4
  %13 = getelementptr inbounds i8, ptr %1, i64 32
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  %.not21 = icmp eq ptr %14, null
  br i1 %.not21, label %15, label %28

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %1, i64 40
  %17 = load ptr, ptr %16, align 8, !tbaa !18
  %.not22 = icmp eq ptr %17, null
  br i1 %.not22, label %18, label %19

18:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 158, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE) #5
  unreachable

19:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #6
  call void @_ZN3RayC2ERKS_(ptr noundef nonnull align 8 dereferenceable(64) %6, ptr noundef nonnull align 8 dereferenceable(64) %2)
  %20 = load ptr, ptr %17, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %20, i64 40
  %22 = load ptr, ptr %21, align 8
  call void %22(ptr dead_on_unwind nonnull writable sret(%struct.Intersection) align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull %6)
  %23 = load i8, ptr %5, align 8, !tbaa !21, !range !25, !noundef !26
  %24 = trunc nuw i8 %23 to i1
  br i1 %24, label %25, label %26

25:                                               ; preds = %19
  call void @_ZNSt6vectorI12IntersectionSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(48) %5)
  br label %26

26:                                               ; preds = %25, %19
  %27 = call noundef i64 @_ZNKSt6vectorI12IntersectionSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  br label %59

28:                                               ; preds = %12, %4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  %29 = getelementptr inbounds i8, ptr %2, i64 12
  call void @_ZN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %29)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  %30 = getelementptr inbounds i8, ptr %2, i64 24
  call void @_ZN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %30)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #6
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1xEv(ptr noundef nonnull align 1 dereferenceable(1) %7)
  %32 = load float, ptr %31, align 4, !tbaa !27
  %33 = fcmp ogt float %32, 0.000000e+00
  %34 = zext i1 %33 to i32
  store i32 %34, ptr %9, align 4, !tbaa !28
  %35 = getelementptr inbounds i8, ptr %9, i64 4
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1yEv(ptr noundef nonnull align 1 dereferenceable(1) %7)
  %37 = load float, ptr %36, align 4, !tbaa !27
  %38 = fcmp ogt float %37, 0.000000e+00
  %39 = zext i1 %38 to i32
  store i32 %39, ptr %35, align 4, !tbaa !28
  %40 = getelementptr inbounds i8, ptr %9, i64 8
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1zEv(ptr noundef nonnull align 1 dereferenceable(1) %7)
  %42 = load float, ptr %41, align 4, !tbaa !27
  %43 = fcmp ogt float %42, 0.000000e+00
  %44 = zext i1 %43 to i32
  store i32 %44, ptr %40, align 4, !tbaa !28
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = call noundef zeroext i1 @_ZNK7Bounds310IntersectPERK3RayRKN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEERKSt5arrayIiLm3EE(ptr noundef nonnull align 4 dereferenceable(24) %45, ptr noundef nonnull align 8 dereferenceable(64) %2, ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %9)
  br i1 %46, label %47, label %50

47:                                               ; preds = %28
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = call noundef i32 @_ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %48, ptr noundef nonnull align 8 dereferenceable(64) %2, ptr noundef nonnull align 8 dereferenceable(24) %3)
  br label %50

50:                                               ; preds = %47, %28
  %51 = getelementptr inbounds i8, ptr %1, i64 32
  %52 = load ptr, ptr %51, align 8, !tbaa !17
  %53 = call noundef zeroext i1 @_ZNK7Bounds310IntersectPERK3RayRKN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEERKSt5arrayIiLm3EE(ptr noundef nonnull align 4 dereferenceable(24) %52, ptr noundef nonnull align 8 dereferenceable(64) %2, ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %9)
  br i1 %53, label %54, label %57

54:                                               ; preds = %50
  %55 = load ptr, ptr %51, align 8, !tbaa !17
  %56 = call noundef i32 @_ZNK8BVHAccel18getAllIntersectionEP12BVHBuildNodeRK3RayRSt6vectorI12IntersectionSaIS6_EE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %55, ptr noundef nonnull align 8 dereferenceable(64) %2, ptr noundef nonnull align 8 dereferenceable(24) %3)
  br label %57

57:                                               ; preds = %54, %50
  %58 = call noundef i64 @_ZNKSt6vectorI12IntersectionSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  br label %59

59:                                               ; preds = %57, %26
  %.0.in = phi i64 [ %58, %57 ], [ %27, %26 ]
  %.0 = trunc i64 %.0.in to i32
  ret i32 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI12IntersectionSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3RayC2ERKS_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1xEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1yEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEELi1EE1zEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7Bounds310IntersectPERK3RayRKN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEERKSt5arrayIiLm3EE(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI12IntersectionSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #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 = { 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 = { 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 #5 = { noreturn nounwind }
attributes #6 = { 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, !14, i64 24}
!6 = !{!"_ZTS12BVHBuildNode", !7, i64 0, !14, i64 24, !14, i64 32, !14, i64 40, !15, i64 48, !16, i64 52, !16, i64 56, !16, i64 60}
!7 = !{!"_ZTS7Bounds3", !8, i64 0, !8, i64 12}
!8 = !{!"_ZTSN5Eigen6MatrixIfLi3ELi1ELi0ELi3ELi1EEE", !9, i64 0}
!9 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIfLi3ELi1ELi0ELi3ELi1EEEEE", !10, i64 0}
!10 = !{!"_ZTSN5Eigen12DenseStorageIfLi3ELi3ELi1ELi0EEE", !11, i64 0}
!11 = !{!"_ZTSN5Eigen8internal11plain_arrayIfLi3ELi0ELi0EEE", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!"float", !12, i64 0}
!16 = !{!"int", !12, i64 0}
!17 = !{!6, !14, i64 32}
!18 = !{!6, !14, i64 40}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !13, i64 0}
!21 = !{!22, !23, i64 0}
!22 = !{!"_ZTS12Intersection", !23, i64 0, !8, i64 4, !8, i64 16, !24, i64 32, !14, i64 40}
!23 = !{!"bool", !12, i64 0}
!24 = !{!"double", !12, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!15, !15, i64 0}
!28 = !{!16, !16, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass