; LLVM IR from yangfengzzz/DigitalVox3 :: vox.geometry/surfaces (cylinder3)

; 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.vox::geometry::MatrixElemWiseBinaryOp" = type <{ ptr, ptr, [8 x i8] }>
%"class.vox::geometry::Matrix" = type { double, double, double }
%"class.vox::geometry::Matrix.4" = type { double, double }
%"class.vox::geometry::Box" = type { %"class.vox::geometry::Surface.base.10", %"class.vox::geometry::BoundingBox" }
%"class.vox::geometry::Surface.base.10" = type <{ ptr, %"class.vox::geometry::Transform.8", i8 }>
%"class.vox::geometry::Transform.8" = type { %"class.vox::geometry::Matrix.4", %"class.vox::geometry::Orientation.9" }
%"class.vox::geometry::Orientation.9" = type { double, double, double }
%"class.vox::geometry::BoundingBox" = type { %"class.vox::geometry::Matrix.4", %"class.vox::geometry::Matrix.4" }
%"class.vox::geometry::Cylinder3" = type { %"class.vox::geometry::Surface.base", %"class.vox::geometry::Matrix", double, double }
%"class.vox::geometry::Surface.base" = type <{ ptr, %"class.vox::geometry::Transform", i8 }>
%"class.vox::geometry::Transform" = type { %"class.vox::geometry::Matrix", %"class.vox::geometry::Orientation" }
%"class.vox::geometry::Orientation" = type { %"class.vox::geometry::Quaternion", %"class.vox::geometry::Matrix.0", %"class.vox::geometry::Matrix.0" }
%"class.vox::geometry::Quaternion" = type { double, double, double, double }
%"class.vox::geometry::Matrix.0" = type { %"struct.std::array" }
%"struct.std::array" = type { [9 x double] }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox8geometrymiIdLm3ELm1ENS0_6MatrixIdLm3ELm1EEES3_EEDaRKNS0_16MatrixExpressionIT_XT0_EXT1_ET2_EERKNS4_IS5_XT0_EXT1_ET3_EE(ptr dead_on_unwind noalias writable sret(%"class.vox::geometry::MatrixElemWiseBinaryOp") align 8, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) #1

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

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox8geometry6MatrixIdLm2ELm1EEC2ERKdS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox8geometry9TransformILm2EEC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

declare void @_ZN3vox8geometry3BoxILm2EEC1ERKNS0_6MatrixIdLm2ELm1EEES6_RKNS0_9TransformILm2EEEb(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(40), i1 noundef zeroext) unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK3vox8geometry9Cylinder320closestDistanceLocalERKNS0_6MatrixIdLm3ELm1EEE(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.vox::geometry::Matrix", align 8
  %6 = alloca %"class.vox::geometry::MatrixElemWiseBinaryOp", align 8
  %7 = alloca %"class.vox::geometry::Matrix.4", align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.vox::geometry::Box", align 8
  %10 = alloca %"class.vox::geometry::Matrix.4", align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca %"class.vox::geometry::Matrix.4", align 8
  %14 = alloca double, align 8
  %15 = alloca %"class.vox::geometry::Transform.8", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #7
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.vox::geometry::Cylinder3", ptr %18, i32 0, i32 1
  call void @_ZN3vox8geometrymiIdLm3ELm1ENS0_6MatrixIdLm3ELm1EEES3_EEDaRKNS0_16MatrixExpressionIT_XT0_EXT1_ET2_EERKNS4_IS5_XT0_EXT1_ET3_EE(ptr dead_on_unwind writable sret(%"class.vox::geometry::MatrixElemWiseBinaryOp") align 8 %6, ptr noundef nonnull align 1 dereferenceable(1) %19, ptr noundef nonnull align 1 dereferenceable(1) %20)
  call void @_ZN3vox8geometry6MatrixIdLm3ELm1EEC2ILm3ELm1ENS0_22MatrixElemWiseBinaryOpIdLm3ELm1ERKS2_S6_St5minusIdEEEEERKNS0_16MatrixExpressionIdXT_EXT0_ET1_EE(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %21 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %5, i32 0, i32 0
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %5, i32 0, i32 0
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %5, i32 0, i32 2
  %26 = load double, ptr %25, align 8, !tbaa !12
  %27 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %5, i32 0, i32 2
  %28 = load double, ptr %27, align 8, !tbaa !12
  %29 = fmul double %26, %28
  %30 = call double @llvm.fmuladd.f64(double %22, double %24, double %29)
  %31 = call double @sqrt(double noundef %30) #7
  store double %31, ptr %8, align 8, !tbaa !13
  %32 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %5, i32 0, i32 1
  call void @_ZN3vox8geometry6MatrixIdLm2ELm1EEC2ERKdS4_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %32)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 88, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %33 = getelementptr inbounds %"class.vox::geometry::Cylinder3", ptr %18, i32 0, i32 2
  %34 = load double, ptr %33, align 8, !tbaa !14
  %35 = fneg double %34
  store double %35, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %36 = getelementptr inbounds %"class.vox::geometry::Cylinder3", ptr %18, i32 0, i32 3
  %37 = load double, ptr %36, align 8, !tbaa !23
  %38 = fmul double -5.000000e-01, %37
  store double %38, ptr %12, align 8, !tbaa !13
  call void @_ZN3vox8geometry6MatrixIdLm2ELm1EEC2ERKdS4_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  %39 = getelementptr inbounds %"class.vox::geometry::Cylinder3", ptr %18, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %40 = getelementptr inbounds %"class.vox::geometry::Cylinder3", ptr %18, i32 0, i32 3
  %41 = load double, ptr %40, align 8, !tbaa !23
  %42 = fmul double 5.000000e-01, %41
  store double %42, ptr %14, align 8, !tbaa !13
  call void @_ZN3vox8geometry6MatrixIdLm2ELm1EEC2ERKdS4_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #7
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 40, i1 false)
  call void @_ZN3vox8geometry9TransformILm2EEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15)
  call void @_ZN3vox8geometry3BoxILm2EEC1ERKNS0_6MatrixIdLm2ELm1EEES6_RKNS0_9TransformILm2EEEb(ptr noundef nonnull align 8 dereferenceable(88) %9, ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(40) %15, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  %43 = invoke noundef double @_ZNK3vox8geometry7SurfaceILm2EE15closestDistanceERKNS0_6MatrixIdLm2ELm1EEE(ptr noundef nonnull align 8 dereferenceable(49) %9, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %44 unwind label %45

44:                                               ; preds = %2
  call void @_ZN3vox8geometry7SurfaceILm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %9) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  ret double %43

45:                                               ; preds = %2
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %16, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %17, align 4
  call void @_ZN3vox8geometry7SurfaceILm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %9) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  br label %49

49:                                               ; preds = %45
  %50 = load ptr, ptr %16, align 8
  %51 = load i32, ptr %17, align 4
  %52 = insertvalue { ptr, i32 } poison, ptr %50, 0
  %53 = insertvalue { ptr, i32 } %52, i32 %51, 1
  resume { ptr, i32 } %53
}

declare noundef double @_ZNK3vox8geometry7SurfaceILm2EE15closestDistanceERKNS0_6MatrixIdLm2ELm1EEE(ptr noundef nonnull align 8 dereferenceable(49), ptr noundef nonnull align 8 dereferenceable(16)) #6

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

!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, !11, i64 0}
!10 = !{!"_ZTSN3vox8geometry6MatrixIdLm3ELm1EEE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !11, i64 240}
!15 = !{!"_ZTSN3vox8geometry9Cylinder3E", !16, i64 0, !10, i64 216, !11, i64 240, !11, i64 248}
!16 = !{!"_ZTSN3vox8geometry7SurfaceILm3EEE", !17, i64 8, !22, i64 208}
!17 = !{!"_ZTSN3vox8geometry9TransformILm3EEE", !10, i64 0, !18, i64 24}
!18 = !{!"_ZTSN3vox8geometry11OrientationILm3EEE", !19, i64 0, !20, i64 32, !20, i64 104}
!19 = !{!"_ZTSN3vox8geometry10QuaternionIdEE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!20 = !{!"_ZTSN3vox8geometry6MatrixIdLm3ELm3EEE", !21, i64 0}
!21 = !{!"_ZTSSt5arrayIdLm9EE", !7, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!15, !11, i64 248}


; 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.vox::geometry::MatrixElemWiseBinaryOp" = type <{ ptr, ptr, [8 x i8] }>
%"class.vox::geometry::Matrix" = type { double, double, double }
%"class.vox::geometry::Matrix.4" = type { double, double }
%"class.vox::geometry::Box" = type { %"class.vox::geometry::Surface.base.10", %"class.vox::geometry::BoundingBox" }
%"class.vox::geometry::Surface.base.10" = type <{ ptr, %"class.vox::geometry::Transform.8", i8 }>
%"class.vox::geometry::Transform.8" = type { %"class.vox::geometry::Matrix.4", %"class.vox::geometry::Orientation.9" }
%"class.vox::geometry::Orientation.9" = type { double, double, double }
%"class.vox::geometry::BoundingBox" = type { %"class.vox::geometry::Matrix.4", %"class.vox::geometry::Matrix.4" }

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
declare dso_local void @_ZN3vox8geometrymiIdLm3ELm1ENS0_6MatrixIdLm3ELm1EEES3_EEDaRKNS0_16MatrixExpressionIT_XT0_EXT1_ET2_EERKNS4_IS5_XT0_EXT1_ET3_EE(ptr dead_on_unwind noalias writable sret(%"class.vox::geometry::MatrixElemWiseBinaryOp") align 8, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox8geometry6MatrixIdLm3ELm1EEC2ILm3ELm1ENS0_22MatrixElemWiseBinaryOpIdLm3ELm1ERKS2_S6_St5minusIdEEEEERKNS0_16MatrixExpressionIdXT_EXT0_ET1_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) 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) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox8geometry9TransformILm2EEC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

declare void @_ZN3vox8geometry3BoxILm2EEC1ERKNS0_6MatrixIdLm2ELm1EEES6_RKNS0_9TransformILm2EEEb(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(40), i1 noundef zeroext) unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK3vox8geometry9Cylinder320closestDistanceLocalERKNS0_6MatrixIdLm3ELm1EEE(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.vox::geometry::Matrix", align 8
  %4 = alloca %"class.vox::geometry::MatrixElemWiseBinaryOp", align 8
  %5 = alloca %"class.vox::geometry::Matrix.4", align 8
  %6 = alloca double, align 8
  %7 = alloca %"class.vox::geometry::Box", align 8
  %8 = alloca %"class.vox::geometry::Matrix.4", align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca %"class.vox::geometry::Matrix.4", align 8
  %12 = alloca double, align 8
  %13 = alloca %"class.vox::geometry::Transform.8", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %14 = getelementptr inbounds i8, ptr %0, i64 216
  call void @_ZN3vox8geometrymiIdLm3ELm1ENS0_6MatrixIdLm3ELm1EEES3_EEDaRKNS0_16MatrixExpressionIT_XT0_EXT1_ET2_EERKNS4_IS5_XT0_EXT1_ET3_EE(ptr dead_on_unwind nonnull writable sret(%"class.vox::geometry::MatrixElemWiseBinaryOp") align 8 %4, ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %14)
  call void @_ZN3vox8geometry6MatrixIdLm3ELm1EEC2ILm3ELm1ENS0_22MatrixElemWiseBinaryOpIdLm3ELm1ERKS2_S6_St5minusIdEEEEERKNS0_16MatrixExpressionIdXT_EXT0_ET1_EE(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 1 dereferenceable(1) %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %15 = load double, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %3, i64 16
  %17 = load double, ptr %16, align 8, !tbaa !10
  %18 = fmul double %17, %17
  %19 = call double @llvm.fmuladd.f64(double %15, double %15, double %18)
  %sqrt = call double @llvm.sqrt.f64(double %19)
  store double %sqrt, ptr %6, align 8, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  call void @_ZN3vox8geometry6MatrixIdLm2ELm1EEC2ERKdS4_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %21 = getelementptr inbounds i8, ptr %0, i64 240
  %22 = load double, ptr %21, align 8, !tbaa !12
  %23 = fneg double %22
  store double %23, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %24 = getelementptr inbounds i8, ptr %0, i64 248
  %25 = load double, ptr %24, align 8, !tbaa !21
  %26 = fmul double %25, -5.000000e-01
  store double %26, ptr %10, align 8, !tbaa !11
  call void @_ZN3vox8geometry6MatrixIdLm2ELm1EEC2ERKdS4_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %27 = load double, ptr %24, align 8, !tbaa !21
  %28 = fmul double %27, 5.000000e-01
  store double %28, ptr %12, align 8, !tbaa !11
  call void @_ZN3vox8geometry6MatrixIdLm2ELm1EEC2ERKdS4_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %13) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %13, i8 0, i64 40, i1 false)
  call void @_ZN3vox8geometry9TransformILm2EEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13)
  call void @_ZN3vox8geometry3BoxILm2EEC1ERKNS0_6MatrixIdLm2ELm1EEES6_RKNS0_9TransformILm2EEEb(ptr noundef nonnull align 8 dereferenceable(88) %7, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(40) %13, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  %29 = invoke noundef double @_ZNK3vox8geometry7SurfaceILm2EE15closestDistanceERKNS0_6MatrixIdLm2ELm1EEE(ptr noundef nonnull align 8 dereferenceable(49) %7, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %30 unwind label %31

30:                                               ; preds = %2
  call void @_ZN3vox8geometry7SurfaceILm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %7) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  ret double %29

31:                                               ; preds = %2
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3vox8geometry7SurfaceILm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %7) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  resume { ptr, i32 } %32
}

declare noundef double @_ZNK3vox8geometry7SurfaceILm2EE15closestDistanceERKNS0_6MatrixIdLm2ELm1EEE(ptr noundef nonnull align 8 dereferenceable(49), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 speculatable willreturn memory(none) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"_ZTSN3vox8geometry6MatrixIdLm3ELm1EEE", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 16}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 240}
!13 = !{!"_ZTSN3vox8geometry9Cylinder3E", !14, i64 0, !6, i64 216, !7, i64 240, !7, i64 248}
!14 = !{!"_ZTSN3vox8geometry7SurfaceILm3EEE", !15, i64 8, !20, i64 208}
!15 = !{!"_ZTSN3vox8geometry9TransformILm3EEE", !6, i64 0, !16, i64 24}
!16 = !{!"_ZTSN3vox8geometry11OrientationILm3EEE", !17, i64 0, !18, i64 32, !18, i64 104}
!17 = !{!"_ZTSN3vox8geometry10QuaternionIdEE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!18 = !{!"_ZTSN3vox8geometry6MatrixIdLm3ELm3EEE", !19, i64 0}
!19 = !{!"_ZTSSt5arrayIdLm9EE", !8, i64 0}
!20 = !{!"bool", !8, i64 0}
!21 = !{!13, !7, i64 248}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass