; LLVM IR from Slingshot-Physics/slingshot-community :: common/geometry/src (raycast)

; 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.geometry::types::raycastResult_t" = type { i8, i32, [2 x %class.Vector3], [2 x float] }
%class.Vector3 = type { [3 x float] }
%class.Matrix33 = type { [9 x float] }
%"struct.edbdmath::quadraticResult_t" = type { i32, [2 x float] }
%"struct.geometry::types::transform_t" = type { %class.Matrix33, %class.Matrix33, %class.Vector3 }
%"struct.geometry::types::shapeSphere_t" = type { float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8geometry7raycastERK7Vector3S2_RKNS_5types11transform_tERKNS3_13shapeSphere_tE(ptr dead_on_unwind noalias writable sret(%"struct.geometry::types::raycastResult_t") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(84) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %class.Vector3, align 4
  %12 = alloca %class.Matrix33, align 4
  %13 = alloca %class.Matrix33, align 4
  %14 = alloca %class.Matrix33, align 4
  %15 = alloca %class.Vector3, align 4
  %16 = alloca %class.Vector3, align 4
  %17 = alloca %class.Vector3, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca %"struct.edbdmath::quadraticResult_t", align 4
  %22 = alloca { i64, float }, align 8
  %23 = alloca %class.Vector3, align 4
  %24 = alloca %class.Vector3, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca %class.Vector3, align 4
  %28 = alloca %class.Vector3, align 4
  store ptr %0, ptr %6, align 8
  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
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #7
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %29, ptr noundef nonnull align 4 dereferenceable(12) %30)
  call void @llvm.lifetime.start.p0(i64 36, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 36, ptr %13) #7
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.geometry::types::transform_t", ptr %31, i32 0, i32 0
  call void @_ZNK8Matrix33coEv(ptr dead_on_unwind writable sret(%class.Matrix33) align 4 %13, ptr noundef nonnull align 4 dereferenceable(36) %32)
  call void @llvm.lifetime.start.p0(i64 36, ptr %14) #7
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.geometry::types::transform_t", ptr %33, i32 0, i32 1
  call void @_ZNK8Matrix339transposeEv(ptr dead_on_unwind writable sret(%class.Matrix33) align 4 %14, ptr noundef nonnull align 4 dereferenceable(36) %34)
  call void @_ZNK8Matrix33mlERKS_(ptr dead_on_unwind writable sret(%class.Matrix33) align 4 %12, ptr noundef nonnull align 4 dereferenceable(36) %13, ptr noundef nonnull align 4 dereferenceable(36) %14)
  call void @llvm.lifetime.end.p0(i64 36, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.geometry::types::transform_t", ptr %36, i32 0, i32 2
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %35, ptr noundef nonnull align 4 dereferenceable(12) %37)
  call void @_ZNK8Matrix33mlERK7Vector3(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %15, ptr noundef nonnull align 4 dereferenceable(36) %12, ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  call void @_ZNK8Matrix33mlERK7Vector3(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %17, ptr noundef nonnull align 4 dereferenceable(36) %12, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %38 = call noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12) %15)
  store float %38, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %39 = call noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %15)
  store float %39, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %40 = call noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12) %17)
  store float %40, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #7
  %41 = load float, ptr %20, align 4, !tbaa !9
  %42 = load float, ptr %19, align 4, !tbaa !9
  %43 = fmul float 2.000000e+00, %42
  %44 = load float, ptr %18, align 4, !tbaa !9
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.geometry::types::shapeSphere_t", ptr %45, i32 0, i32 0
  %47 = load float, ptr %46, align 4, !tbaa !11
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.geometry::types::shapeSphere_t", ptr %48, i32 0, i32 0
  %50 = load float, ptr %49, align 4, !tbaa !11
  %51 = fneg float %47
  %52 = call float @llvm.fmuladd.f32(float %51, float %50, float %44)
  %53 = call { i64, float } @_ZN8edbdmath14quadraticRootsEfff(float noundef %41, float noundef %43, float noundef %52)
  store { i64, float } %53, ptr %22, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 8 %22, i64 12, i1 false)
  call void @_ZN8geometry5types15raycastResult_tC2Ev(ptr noundef nonnull align 4 dereferenceable(40) %0)
  %54 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 0
  %55 = load i32, ptr %54, align 4, !tbaa !13
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %5
  %58 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 1
  store i32 0, ptr %58, align 4, !tbaa !16
  %59 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 0
  store i8 0, ptr %59, align 4, !tbaa !19
  br label %141

60:                                               ; preds = %5
  %61 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 0
  %62 = load i32, ptr %61, align 4, !tbaa !13
  %63 = icmp eq i32 %62, 1
  br i1 %63, label %64, label %89

64:                                               ; preds = %60
  %65 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 1
  %66 = getelementptr inbounds [2 x float], ptr %65, i64 0, i64 0
  %67 = load float, ptr %66, align 4, !tbaa !9
  %68 = fcmp oge float %67, 0.000000e+00
  br i1 %68, label %69, label %85

69:                                               ; preds = %64
  %70 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 0
  store i8 1, ptr %70, align 4, !tbaa !19
  %71 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 0
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 1
  store i32 %72, ptr %73, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #7
  %74 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 1
  %75 = getelementptr inbounds [2 x float], ptr %74, i64 0, i64 0
  call void @_ZmlRKfRK7Vector3(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %24, ptr noundef nonnull align 4 dereferenceable(4) %75, ptr noundef nonnull align 4 dereferenceable(12) %11)
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNK7Vector3plERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %23, ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef nonnull align 4 dereferenceable(12) %76)
  %77 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 2
  %78 = getelementptr inbounds [2 x %class.Vector3], ptr %77, i64 0, i64 0
  %79 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %78, ptr noundef nonnull align 4 dereferenceable(12) %23)
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #7
  %80 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 1
  %81 = getelementptr inbounds [2 x float], ptr %80, i64 0, i64 0
  %82 = load float, ptr %81, align 4, !tbaa !9
  %83 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 3
  %84 = getelementptr inbounds [2 x float], ptr %83, i64 0, i64 0
  store float %82, ptr %84, align 4, !tbaa !9
  br label %88

85:                                               ; preds = %64
  %86 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 1
  store i32 0, ptr %86, align 4, !tbaa !16
  %87 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 0
  store i8 0, ptr %87, align 4, !tbaa !19
  br label %88

88:                                               ; preds = %85, %69
  br label %140

89:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %90 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 1
  store ptr %90, ptr %25, align 8, !tbaa !5
  %91 = load ptr, ptr %25, align 8, !tbaa !5
  store i32 0, ptr %91, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !20
  br label %92

92:                                               ; preds = %131, %89
  %93 = load i32, ptr %26, align 4, !tbaa !20
  %94 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 0
  %95 = load i32, ptr %94, align 4, !tbaa !13
  %96 = icmp ult i32 %93, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %134

98:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %28) #7
  %99 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 1
  %100 = load i32, ptr %26, align 4, !tbaa !20
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds [2 x float], ptr %99, i64 0, i64 %101
  call void @_ZmlRKfRK7Vector3(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %28, ptr noundef nonnull align 4 dereferenceable(4) %102, ptr noundef nonnull align 4 dereferenceable(12) %11)
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNK7Vector3plERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %27, ptr noundef nonnull align 4 dereferenceable(12) %28, ptr noundef nonnull align 4 dereferenceable(12) %103)
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #7
  %104 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 1
  %105 = load i32, ptr %26, align 4, !tbaa !20
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds [2 x float], ptr %104, i64 0, i64 %106
  %108 = load float, ptr %107, align 4, !tbaa !9
  %109 = fcmp oge float %108, 0.000000e+00
  br i1 %109, label %110, label %130

110:                                              ; preds = %98
  %111 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 2
  %112 = load ptr, ptr %25, align 8, !tbaa !5
  %113 = load i32, ptr %112, align 4, !tbaa !20
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds [2 x %class.Vector3], ptr %111, i64 0, i64 %114
  %116 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %115, ptr noundef nonnull align 4 dereferenceable(12) %27)
  %117 = getelementptr inbounds %"struct.edbdmath::quadraticResult_t", ptr %21, i32 0, i32 1
  %118 = load i32, ptr %26, align 4, !tbaa !20
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds [2 x float], ptr %117, i64 0, i64 %119
  %121 = load float, ptr %120, align 4, !tbaa !9
  %122 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 3
  %123 = load ptr, ptr %25, align 8, !tbaa !5
  %124 = load i32, ptr %123, align 4, !tbaa !20
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds [2 x float], ptr %122, i64 0, i64 %125
  store float %121, ptr %126, align 4, !tbaa !9
  %127 = load ptr, ptr %25, align 8, !tbaa !5
  %128 = load i32, ptr %127, align 4, !tbaa !20
  %129 = add i32 %128, 1
  store i32 %129, ptr %127, align 4, !tbaa !20
  br label %130

130:                                              ; preds = %110, %98
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #7
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %26, align 4, !tbaa !20
  %133 = add i32 %132, 1
  store i32 %133, ptr %26, align 4, !tbaa !20
  br label %92, !llvm.loop !21

134:                                              ; preds = %97
  %135 = load ptr, ptr %25, align 8, !tbaa !5
  %136 = load i32, ptr %135, align 4, !tbaa !20
  %137 = icmp ugt i32 %136, 0
  %138 = getelementptr inbounds %"struct.geometry::types::raycastResult_t", ptr %0, i32 0, i32 0
  %139 = zext i1 %137 to i8
  store i8 %139, ptr %138, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %140

140:                                              ; preds = %134, %88
  br label %141

141:                                              ; preds = %140, %57
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  ret void
}

; 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 @_ZNK7Vector3miERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8Matrix33coEv(ptr dead_on_unwind noalias writable sret(%class.Matrix33) align 4, ptr noundef nonnull align 4 dereferenceable(36)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8Matrix33mlERKS_(ptr dead_on_unwind noalias writable sret(%class.Matrix33) align 4, ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(36)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8Matrix339transposeEv(ptr dead_on_unwind noalias writable sret(%class.Matrix33) align 4, ptr noundef nonnull align 4 dereferenceable(36)) #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: mustprogress uwtable
declare dso_local void @_ZNK8Matrix33mlERK7Vector3(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

declare { i64, float } @_ZN8edbdmath14quadraticRootsEfff(float noundef, float noundef, float noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

declare void @_ZmlRKfRK7Vector3(ptr dead_on_unwind writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector3plERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 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 = { 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 #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN8geometry5types13shapeSphere_tE", !10, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN8edbdmath17quadraticResult_tE", !15, i64 0, !7, i64 4}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !15, i64 4}
!17 = !{!"_ZTSN8geometry5types15raycastResult_tE", !18, i64 0, !15, i64 4, !7, i64 8, !7, i64 32}
!18 = !{!"bool", !7, i64 0}
!19 = !{!17, !18, i64 0}
!20 = !{!15, !15, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.geometry::types::raycastResult_t" = type { i8, i32, [2 x %class.Vector3], [2 x float] }
%class.Vector3 = type { [3 x float] }
%class.Matrix33 = type { [9 x float] }
%"struct.edbdmath::quadraticResult_t" = type { i32, [2 x float] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8geometry7raycastERK7Vector3S2_RKNS_5types11transform_tERKNS3_13shapeSphere_tE(ptr dead_on_unwind noalias writable sret(%"struct.geometry::types::raycastResult_t") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(84) %3, ptr nocapture noundef nonnull readonly align 4 dereferenceable(4) %4) local_unnamed_addr #0 {
  %6 = alloca %class.Vector3, align 4
  %7 = alloca %class.Matrix33, align 4
  %8 = alloca %class.Matrix33, align 4
  %9 = alloca %class.Matrix33, align 4
  %10 = alloca %class.Vector3, align 4
  %11 = alloca %class.Vector3, align 4
  %12 = alloca %class.Vector3, align 4
  %13 = alloca %"struct.edbdmath::quadraticResult_t", align 8
  %14 = alloca %class.Vector3, align 4
  %15 = alloca %class.Vector3, align 4
  %16 = alloca %class.Vector3, align 4
  %17 = alloca %class.Vector3, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #6
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %1)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %8) #6
  call void @_ZNK8Matrix33coEv(ptr dead_on_unwind nonnull writable sret(%class.Matrix33) align 4 %8, ptr noundef nonnull align 4 dereferenceable(36) %3)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %9) #6
  %18 = getelementptr inbounds i8, ptr %3, i64 36
  call void @_ZNK8Matrix339transposeEv(ptr dead_on_unwind nonnull writable sret(%class.Matrix33) align 4 %9, ptr noundef nonnull align 4 dereferenceable(36) %18)
  call void @_ZNK8Matrix33mlERKS_(ptr dead_on_unwind nonnull writable sret(%class.Matrix33) align 4 %7, ptr noundef nonnull align 4 dereferenceable(36) %8, ptr noundef nonnull align 4 dereferenceable(36) %9)
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #6
  %19 = getelementptr inbounds i8, ptr %3, i64 72
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @_ZNK8Matrix33mlERK7Vector3(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %10, ptr noundef nonnull align 4 dereferenceable(36) %7, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #6
  call void @_ZNK8Matrix33mlERK7Vector3(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %12, ptr noundef nonnull align 4 dereferenceable(36) %7, ptr noundef nonnull align 4 dereferenceable(12) %6)
  %20 = call noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %21 = call noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %22 = call noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #6
  %23 = fmul float %21, 2.000000e+00
  %24 = load float, ptr %4, align 4, !tbaa !5
  %25 = fneg float %24
  %26 = call float @llvm.fmuladd.f32(float %25, float %24, float %20)
  %27 = call { i64, float } @_ZN8edbdmath14quadraticRootsEfff(float noundef %22, float noundef %23, float noundef %26)
  %.fca.0.extract = extractvalue { i64, float } %27, 0
  %.fca.1.extract = extractvalue { i64, float } %27, 1
  store i64 %.fca.0.extract, ptr %13, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZN8geometry5types15raycastResult_tC2Ev(ptr noundef nonnull align 4 dereferenceable(40) %0)
  %28 = trunc i64 %.fca.0.extract to i32
  switch i32 %28, label %.lr.ph [
    i32 0, label %29
    i32 1, label %31
  ]

29:                                               ; preds = %5
  %30 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 0, ptr %30, align 4, !tbaa !10
  store i8 0, ptr %0, align 4, !tbaa !14
  br label %69

31:                                               ; preds = %5
  %32 = lshr i64 %.fca.0.extract, 32
  %33 = trunc nuw i64 %32 to i32
  %34 = bitcast i32 %33 to float
  %35 = fcmp ult float %34, 0.000000e+00
  br i1 %35, label %43, label %36

36:                                               ; preds = %31
  %37 = getelementptr inbounds i8, ptr %13, i64 4
  store i8 1, ptr %0, align 4, !tbaa !14
  %38 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 1, ptr %38, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #6
  call void @_ZmlRKfRK7Vector3(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %15, ptr noundef nonnull align 4 dereferenceable(4) %37, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @_ZNK7Vector3plERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %15, ptr noundef nonnull align 4 dereferenceable(12) %1)
  %39 = getelementptr inbounds i8, ptr %0, i64 8
  %40 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #6
  %41 = load float, ptr %37, align 4, !tbaa !15
  %42 = getelementptr inbounds i8, ptr %0, i64 32
  store float %41, ptr %42, align 4, !tbaa !15
  br label %69

43:                                               ; preds = %31
  %44 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 0, ptr %44, align 4, !tbaa !10
  store i8 0, ptr %0, align 4, !tbaa !14
  br label %69

.lr.ph:                                           ; preds = %5
  %45 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 0, ptr %45, align 4, !tbaa !16
  %46 = getelementptr inbounds i8, ptr %13, i64 4
  %47 = getelementptr inbounds i8, ptr %0, i64 8
  %48 = getelementptr inbounds i8, ptr %0, i64 32
  br label %51

._crit_edge:                                      ; preds = %65
  %.pre = load i32, ptr %45, align 4, !tbaa !16
  %49 = icmp ne i32 %.pre, 0
  %50 = zext i1 %49 to i8
  store i8 %50, ptr %0, align 4, !tbaa !14
  br label %69

51:                                               ; preds = %.lr.ph, %65
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %65 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #6
  %52 = getelementptr inbounds [2 x float], ptr %46, i64 0, i64 %indvars.iv
  call void @_ZmlRKfRK7Vector3(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %17, ptr noundef nonnull align 4 dereferenceable(4) %52, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @_ZNK7Vector3plERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %1)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #6
  %53 = load float, ptr %52, align 4, !tbaa !15
  %54 = fcmp ult float %53, 0.000000e+00
  br i1 %54, label %65, label %55

55:                                               ; preds = %51
  %56 = load i32, ptr %45, align 4, !tbaa !16
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds [2 x %class.Vector3], ptr %47, i64 0, i64 %57
  %59 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %58, ptr noundef nonnull align 4 dereferenceable(12) %16)
  %60 = load float, ptr %52, align 4, !tbaa !15
  %61 = load i32, ptr %45, align 4, !tbaa !16
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds [2 x float], ptr %48, i64 0, i64 %62
  store float %60, ptr %63, align 4, !tbaa !15
  %64 = add i32 %61, 1
  store i32 %64, ptr %45, align 4, !tbaa !16
  br label %65

65:                                               ; preds = %55, %51
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %66 = load i32, ptr %13, align 8, !tbaa !17
  %67 = zext i32 %66 to i64
  %68 = icmp ult i64 %indvars.iv.next, %67
  br i1 %68, label %51, label %._crit_edge, !llvm.loop !19

69:                                               ; preds = %._crit_edge, %43, %36, %29
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #6
  ret void
}

; 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 @_ZNK7Vector3miERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8Matrix33coEv(ptr dead_on_unwind noalias writable sret(%class.Matrix33) align 4, ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8Matrix33mlERKS_(ptr dead_on_unwind noalias writable sret(%class.Matrix33) align 4, ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8Matrix339transposeEv(ptr dead_on_unwind noalias writable sret(%class.Matrix33) align 4, ptr noundef nonnull align 4 dereferenceable(36)) local_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 uwtable
declare dso_local void @_ZNK8Matrix33mlERK7Vector3(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

declare { i64, float } @_ZN8edbdmath14quadraticRootsEfff(float noundef, float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

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

declare void @_ZmlRKfRK7Vector3(ptr dead_on_unwind writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector3plERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = !{!"_ZTSN8geometry5types13shapeSphere_tE", !7, i64 0}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !13, i64 4}
!11 = !{!"_ZTSN8geometry5types15raycastResult_tE", !12, i64 0, !13, i64 4, !8, i64 8, !8, i64 32}
!12 = !{!"bool", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!11, !12, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !13, i64 0}
!18 = !{!"_ZTSN8edbdmath17quadraticResult_tE", !13, i64 0, !8, i64 4}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass