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

51:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %52 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %7, i32 0, i32 2
  %53 = load double, ptr %52, align 8, !tbaa !12
  %54 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %7, i32 0, i32 0
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = call double @atan2(double noundef %53, double noundef %55) #7
  store double %56, ptr %21, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %57 = getelementptr inbounds %"class.vox::geometry::Matrix.4", ptr %18, i32 0, i32 0
  %58 = load double, ptr %57, align 8, !tbaa !24
  %59 = load double, ptr %21, align 8, !tbaa !13
  %60 = call double @cos(double noundef %59) #7
  %61 = fmul double %58, %60
  store double %61, ptr %24, align 8, !tbaa !13
  %62 = getelementptr inbounds %"class.vox::geometry::Matrix.4", ptr %18, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %63 = getelementptr inbounds %"class.vox::geometry::Matrix.4", ptr %18, i32 0, i32 0
  %64 = load double, ptr %63, align 8, !tbaa !24
  %65 = load double, ptr %21, align 8, !tbaa !13
  %66 = call double @sin(double noundef %65) #7
  %67 = fmul double %64, %66
  store double %67, ptr %25, align 8, !tbaa !13
  invoke void @_ZN3vox8geometry6MatrixIdLm3ELm1EEC2ERKdS4_S4_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %68 unwind label %76

68:                                               ; preds = %51
  %69 = getelementptr inbounds %"class.vox::geometry::Cylinder3", ptr %26, i32 0, i32 1
  invoke void @_ZN3vox8geometryplIdLm3ELm1ENS0_6MatrixIdLm3ELm1EEES3_EEDaRKNS0_16MatrixExpressionIT_XT0_EXT1_ET2_EERKNS4_IS5_XT0_EXT1_ET3_EE(ptr dead_on_unwind writable sret(%"class.vox::geometry::MatrixElemWiseBinaryOp.11") align 8 %22, ptr noundef nonnull align 1 dereferenceable(1) %23, ptr noundef nonnull align 1 dereferenceable(1) %69)
          to label %70 unwind label %76

70:                                               ; preds = %68
  invoke void @_ZN3vox8geometry6MatrixIdLm3ELm1EEC2ILm3ELm1ENS0_22MatrixElemWiseBinaryOpIdLm3ELm1ERKS2_S6_St4plusIdEEEEERKNS0_16MatrixExpressionIdXT_EXT0_ET1_EE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 1 dereferenceable(1) %22)
          to label %71 unwind label %76

71:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @_ZN3vox8geometry7SurfaceILm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %11) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  ret void

72:                                               ; preds = %3
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %19, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %20, align 4
  br label %80

76:                                               ; preds = %70, %68, %51
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %19, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %80

80:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @_ZN3vox8geometry7SurfaceILm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %11) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %19, align 8
  %83 = load i32, ptr %20, align 4
  %84 = insertvalue { ptr, i32 } poison, ptr %82, 0
  %85 = insertvalue { ptr, i32 } %84, i32 %83, 1
  resume { ptr, i32 } %85
}

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

; 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)) #0

; 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 #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: 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 #0 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

declare void @_ZNK3vox8geometry7SurfaceILm2EE12closestPointERKNS0_6MatrixIdLm2ELm1EEE(ptr dead_on_unwind writable sret(%"class.vox::geometry::Matrix.4") align 8, ptr noundef nonnull align 8 dereferenceable(49), ptr noundef nonnull align 8 dereferenceable(16)) #6

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

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

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

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

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

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

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

attributes #0 = { 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 = { 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}
!24 = !{!25, !11, i64 0}
!25 = !{!"_ZTSN3vox8geometry6MatrixIdLm2ELm1EEE", !11, i64 0, !11, i64 8}


; 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::Matrix" = type { double, double, double }
%"class.vox::geometry::MatrixElemWiseBinaryOp" = type <{ ptr, ptr, [8 x i8] }>
%"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::MatrixElemWiseBinaryOp.11" = type <{ ptr, ptr, [8 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

35:                                               ; preds = %3
  %36 = load double, ptr %22, align 8, !tbaa !10
  %37 = load double, ptr %4, align 8, !tbaa !5
  %38 = call double @atan2(double noundef %36, double noundef %37) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #8
  %39 = load double, ptr %15, align 8, !tbaa !22
  %40 = call double @cos(double noundef %38) #8
  %41 = fmul double %39, %40
  store double %41, ptr %18, align 8, !tbaa !11
  %42 = getelementptr inbounds i8, ptr %15, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #8
  %43 = load double, ptr %15, align 8, !tbaa !22
  %44 = call double @sin(double noundef %38) #8
  %45 = fmul double %43, %44
  store double %45, ptr %19, align 8, !tbaa !11
  call void @_ZN3vox8geometry6MatrixIdLm3ELm1EEC2ERKdS4_S4_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull align 8 dereferenceable(8) %19)
  invoke void @_ZN3vox8geometryplIdLm3ELm1ENS0_6MatrixIdLm3ELm1EEES3_EEDaRKNS0_16MatrixExpressionIT_XT0_EXT1_ET2_EERKNS4_IS5_XT0_EXT1_ET3_EE(ptr dead_on_unwind nonnull writable sret(%"class.vox::geometry::MatrixElemWiseBinaryOp.11") align 8 %16, ptr noundef nonnull align 1 dereferenceable(1) %17, ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %46 unwind label %50

46:                                               ; preds = %35
  invoke void @_ZN3vox8geometry6MatrixIdLm3ELm1EEC2ILm3ELm1ENS0_22MatrixElemWiseBinaryOpIdLm3ELm1ERKS2_S6_St4plusIdEEEEERKNS0_16MatrixExpressionIdXT_EXT0_ET1_EE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %47 unwind label %50

47:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #8
  call void @_ZN3vox8geometry7SurfaceILm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %8) #8
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  ret void

48:                                               ; preds = %3
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %46, %35
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #8
  br label %52

52:                                               ; preds = %50, %48
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #8
  call void @_ZN3vox8geometry7SurfaceILm2EED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %8) #8
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn
}

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

; 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 #0

; 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 #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: 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 #0 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

declare void @_ZNK3vox8geometry7SurfaceILm2EE12closestPointERKNS0_6MatrixIdLm2ELm1EEE(ptr dead_on_unwind writable sret(%"class.vox::geometry::Matrix.4") align 8, ptr noundef nonnull align 8 dereferenceable(49), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #6

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

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

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

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

attributes #0 = { 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 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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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}
!22 = !{!23, !7, i64 0}
!23 = !{!"_ZTSN3vox8geometry6MatrixIdLm2ELm1EEE", !7, i64 0, !7, i64 8}


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