; LLVM IR from doyubkim/fluid-engine-dev :: src/jet/cylinder3.ll (ZNK3jet9Cylinder318closestNormalLocalERKNS_6VectorIdLm3EEE)

; 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.jet::Vector" = type { double, double, double }
%"class.jet::Vector.0" = type { double, double }
%"class.jet::Box2" = type { %"class.jet::Surface2.base", %"class.jet::BoundingBox" }
%"class.jet::Surface2.base" = type <{ ptr, %"class.jet::Transform2", i8 }>
%"class.jet::Transform2" = type { %"class.jet::Vector.0", double, double, double }
%"class.jet::BoundingBox" = type { %"class.jet::Vector.0", %"class.jet::Vector.0" }
%"class.jet::Cylinder3" = type { %"class.jet::Surface3.base", %"class.jet::Vector", double, double }
%"class.jet::Surface3.base" = type <{ ptr, %"class.jet::Transform3", i8 }>
%"class.jet::Transform3" = type { %"class.jet::Vector", %"class.jet::Quaternion", %"class.jet::Matrix", %"class.jet::Matrix" }
%"class.jet::Quaternion" = type { double, double, double, double }
%"class.jet::Matrix" = 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 @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #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 @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #4 align 2

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

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

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

; Function Attrs: nounwind
declare void @_ZN3jet8Surface2D2Ev(ptr noundef nonnull align 8 dereferenceable(49)) unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3jet9Cylinder318closestNormalLocalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(256) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) unnamed_addr #1 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.jet::Vector", align 8
  %8 = alloca %"class.jet::Vector.0", align 8
  %9 = alloca %"class.jet::Box2", align 8
  %10 = alloca %"class.jet::Vector.0", align 8
  %11 = alloca %"class.jet::Vector.0", align 8
  %12 = alloca %"class.jet::Transform2", align 8
  %13 = alloca %"class.jet::Vector.0", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.jet::Vector", 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
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #7
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.jet::Cylinder3", ptr %18, i32 0, i32 1
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #7
  %21 = getelementptr inbounds %"class.jet::Vector", ptr %7, i32 0, i32 0
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds %"class.jet::Vector", ptr %7, i32 0, i32 0
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %"class.jet::Vector", ptr %7, i32 0, i32 2
  %26 = load double, ptr %25, align 8, !tbaa !12
  %27 = getelementptr inbounds %"class.jet::Vector", ptr %7, 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
  %32 = getelementptr inbounds %"class.jet::Vector", ptr %7, i32 0, i32 1
  %33 = load double, ptr %32, align 8, !tbaa !13
  call void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %8, double noundef %31, double noundef %33)
  call void @llvm.lifetime.start.p0(i64 88, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  %34 = getelementptr inbounds %"class.jet::Cylinder3", ptr %18, i32 0, i32 2
  %35 = load double, ptr %34, align 8, !tbaa !14
  %36 = fneg double %35
  %37 = getelementptr inbounds %"class.jet::Cylinder3", ptr %18, i32 0, i32 3
  %38 = load double, ptr %37, align 8, !tbaa !22
  %39 = fmul double -5.000000e-01, %38
  call void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %10, double noundef %36, double noundef %39)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %40 = getelementptr inbounds %"class.jet::Cylinder3", ptr %18, i32 0, i32 2
  %41 = load double, ptr %40, align 8, !tbaa !14
  %42 = getelementptr inbounds %"class.jet::Cylinder3", ptr %18, i32 0, i32 3
  %43 = load double, ptr %42, align 8, !tbaa !22
  %44 = fmul double 5.000000e-01, %43
  call void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef %41, double noundef %44)
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #7
  call void @_ZN3jet10Transform2C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12)
  call void @_ZN3jet4Box2C1ERKNS_6VectorIdLm2EEES4_RKNS_10Transform2Eb(ptr noundef nonnull align 8 dereferenceable(88) %9, ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(40) %12, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  invoke void @_ZNK3jet8Surface213closestNormalERKNS_6VectorIdLm2EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector.0") align 8 %13, ptr noundef nonnull align 8 dereferenceable(49) %9, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %45 unwind label %51

45:                                               ; preds = %3
  %46 = getelementptr inbounds %"class.jet::Vector.0", ptr %13, i32 0, i32 1
  %47 = load double, ptr %46, align 8, !tbaa !23
  %48 = fcmp ogt double %47, 0.000000e+00
  br i1 %48, label %49, label %55

49:                                               ; preds = %45
  invoke void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %50 unwind label %51

50:                                               ; preds = %49
  store i32 1, ptr %16, align 4
  br label %72

51:                                               ; preds = %59, %49, %3
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %14, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %15, align 4
  br label %73

55:                                               ; preds = %45
  %56 = getelementptr inbounds %"class.jet::Vector.0", ptr %13, i32 0, i32 1
  %57 = load double, ptr %56, align 8, !tbaa !23
  %58 = fcmp olt double %57, 0.000000e+00
  br i1 %58, label %59, label %61

59:                                               ; preds = %55
  invoke void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef 0.000000e+00, double noundef -1.000000e+00, double noundef 0.000000e+00)
          to label %60 unwind label %51

60:                                               ; preds = %59
  store i32 1, ptr %16, align 4
  br label %72

61:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #7
  %62 = getelementptr inbounds %"class.jet::Vector", ptr %7, i32 0, i32 0
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds %"class.jet::Vector", ptr %7, i32 0, i32 2
  %65 = load double, ptr %64, align 8, !tbaa !12
  invoke void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %17, double noundef %63, double noundef 0.000000e+00, double noundef %65)
          to label %66 unwind label %68

66:                                               ; preds = %61
  invoke void @_ZNK3jet6VectorIdLm3EE10normalizedEv(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %67 unwind label %68

67:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  store i32 1, ptr %16, align 4
  br label %72

68:                                               ; preds = %66, %61
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %14, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %73

72:                                               ; preds = %67, %60, %50
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  call void @_ZN3jet8Surface2D2Ev(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 %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  ret void

73:                                               ; preds = %68, %51
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  call void @_ZN3jet8Surface2D2Ev(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 %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %14, align 8
  %76 = load i32, ptr %15, align 4
  %77 = insertvalue { ptr, i32 } poison, ptr %75, 0
  %78 = insertvalue { ptr, i32 } %77, i32 %76, 1
  resume { ptr, i32 } %78
}

declare void @_ZNK3jet8Surface213closestNormalERKNS_6VectorIdLm2EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector.0") align 8, ptr noundef nonnull align 8 dereferenceable(49), ptr noundef nonnull align 8 dereferenceable(16)) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet6VectorIdLm3EE10normalizedEv(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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 = { 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 #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 = !{!"_ZTSN3jet6VectorIdLm3EEE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = !{!10, !11, i64 8}
!14 = !{!15, !11, i64 240}
!15 = !{!"_ZTSN3jet9Cylinder3E", !16, i64 0, !10, i64 216, !11, i64 240, !11, i64 248}
!16 = !{!"_ZTSN3jet8Surface3E", !17, i64 8, !21, i64 208}
!17 = !{!"_ZTSN3jet10Transform3E", !10, i64 0, !18, i64 24, !19, i64 56, !19, i64 128}
!18 = !{!"_ZTSN3jet10QuaternionIdEE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!19 = !{!"_ZTSN3jet6MatrixIdLm3ELm3EEE", !20, i64 0}
!20 = !{!"_ZTSSt5arrayIdLm9EE", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!15, !11, i64 248}
!23 = !{!24, !11, i64 8}
!24 = !{!"_ZTSN3jet6VectorIdLm2EEE", !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.jet::Vector" = type { double, double, double }
%"class.jet::Vector.0" = type { double, double }
%"class.jet::Box2" = type { %"class.jet::Surface2.base", %"class.jet::BoundingBox" }
%"class.jet::Surface2.base" = type <{ ptr, %"class.jet::Transform2", i8 }>
%"class.jet::Transform2" = type { %"class.jet::Vector.0", double, double, double }
%"class.jet::BoundingBox" = type { %"class.jet::Vector.0", %"class.jet::Vector.0" }

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 @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #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 @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #3 align 2

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

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

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

; Function Attrs: nounwind
declare void @_ZN3jet8Surface2D2Ev(ptr noundef nonnull align 8 dereferenceable(49)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3jet9Cylinder318closestNormalLocalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(256) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.jet::Vector", align 8
  %5 = alloca %"class.jet::Vector.0", align 8
  %6 = alloca %"class.jet::Box2", align 8
  %7 = alloca %"class.jet::Vector.0", align 8
  %8 = alloca %"class.jet::Vector.0", align 8
  %9 = alloca %"class.jet::Transform2", align 8
  %10 = alloca %"class.jet::Vector.0", align 8
  %11 = alloca %"class.jet::Vector", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  %12 = getelementptr inbounds i8, ptr %1, i64 216
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %13 = load double, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %4, i64 16
  %15 = load double, ptr %14, align 8, !tbaa !10
  %16 = fmul double %15, %15
  %17 = call double @llvm.fmuladd.f64(double %13, double %13, double %16)
  %sqrt = call double @llvm.sqrt.f64(double %17)
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  %19 = load double, ptr %18, align 8, !tbaa !11
  call void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef %sqrt, double noundef %19)
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #8
  %20 = getelementptr inbounds i8, ptr %1, i64 240
  %21 = load double, ptr %20, align 8, !tbaa !12
  %22 = fneg double %21
  %23 = getelementptr inbounds i8, ptr %1, i64 248
  %24 = load double, ptr %23, align 8, !tbaa !20
  %25 = fmul double %24, -5.000000e-01
  call void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %22, double noundef %25)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  %26 = load double, ptr %20, align 8, !tbaa !12
  %27 = load double, ptr %23, align 8, !tbaa !20
  %28 = fmul double %27, 5.000000e-01
  call void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %8, double noundef %26, double noundef %28)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #8
  call void @_ZN3jet10Transform2C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9)
  call void @_ZN3jet4Box2C1ERKNS_6VectorIdLm2EEES4_RKNS_10Transform2Eb(ptr noundef nonnull align 8 dereferenceable(88) %6, ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(40) %9, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  invoke void @_ZNK3jet8Surface213closestNormalERKNS_6VectorIdLm2EEE(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector.0") align 8 %10, ptr noundef nonnull align 8 dereferenceable(49) %6, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %29 unwind label %34

29:                                               ; preds = %3
  %30 = getelementptr inbounds i8, ptr %10, i64 8
  %31 = load double, ptr %30, align 8, !tbaa !21
  %32 = fcmp ogt double %31, 0.000000e+00
  br i1 %32, label %33, label %36

33:                                               ; preds = %29
  call void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 0.000000e+00)
  br label %45

34:                                               ; preds = %3
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %46

36:                                               ; preds = %29
  %37 = fcmp olt double %31, 0.000000e+00
  br i1 %37, label %38, label %39

38:                                               ; preds = %36
  call void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef 0.000000e+00, double noundef -1.000000e+00, double noundef 0.000000e+00)
  br label %45

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #8
  %40 = load double, ptr %4, align 8, !tbaa !5
  %41 = load double, ptr %14, align 8, !tbaa !10
  call void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %11, double noundef %40, double noundef 0.000000e+00, double noundef %41)
  invoke void @_ZNK3jet6VectorIdLm3EE10normalizedEv(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %42 unwind label %43

42:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #8
  br label %45

43:                                               ; preds = %39
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #8
  br label %46

45:                                               ; preds = %42, %38, %33
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @_ZN3jet8Surface2D2Ev(ptr noundef nonnull align 8 dereferenceable(88) %6) #8
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  ret void

46:                                               ; preds = %43, %34
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @_ZN3jet8Surface2D2Ev(ptr noundef nonnull align 8 dereferenceable(88) %6) #8
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn
}

declare void @_ZNK3jet8Surface213closestNormalERKNS_6VectorIdLm2EEE(ptr dead_on_unwind writable sret(%"class.jet::Vector.0") align 8, ptr noundef nonnull align 8 dereferenceable(49), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet6VectorIdLm3EE10normalizedEv(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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 = { 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 = { "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 = { 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 #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 = !{!"_ZTSN3jet6VectorIdLm3EEE", !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 = !{!6, !7, i64 8}
!12 = !{!13, !7, i64 240}
!13 = !{!"_ZTSN3jet9Cylinder3E", !14, i64 0, !6, i64 216, !7, i64 240, !7, i64 248}
!14 = !{!"_ZTSN3jet8Surface3E", !15, i64 8, !19, i64 208}
!15 = !{!"_ZTSN3jet10Transform3E", !6, i64 0, !16, i64 24, !17, i64 56, !17, i64 128}
!16 = !{!"_ZTSN3jet10QuaternionIdEE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!17 = !{!"_ZTSN3jet6MatrixIdLm3ELm3EEE", !18, i64 0}
!18 = !{!"_ZTSSt5arrayIdLm9EE", !8, i64 0}
!19 = !{!"bool", !8, i64 0}
!20 = !{!13, !7, i64 248}
!21 = !{!22, !7, i64 8}
!22 = !{!"_ZTSN3jet6VectorIdLm2EEE", !7, i64 0, !7, i64 8}


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