; LLVM IR from Razakhel/RaZ :: src/RaZ/Utils/Ray.ll (ZNK3Raz3Ray10intersectsERKNS_8TriangleEPNS_6RayHitE)

; 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.Raz::Vector" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x float] }
%"class.Raz::Ray" = type { %"class.Raz::Vector", %"class.Raz::Vector", %"class.Raz::Vector" }
%"struct.Raz::RayHit" = type { %"class.Raz::Vector", %"class.Raz::Vector", float }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE9normalizeIfEENS0_IT_Lm3EEEv(ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3Raz10FloatUtils14areNearlyEqualIffEEbT_S2_T0_(float noundef, float noundef, float noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNSt14numeric_limitsIfE7epsilonEv() #2 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 nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEplERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmlEf(ptr noundef nonnull align 4 dereferenceable(12), float noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_8TriangleEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef %2) #3 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.Raz::Vector", align 4
  %9 = alloca { <2 x float>, float }, align 8
  %10 = alloca %"class.Raz::Vector", align 4
  %11 = alloca { <2 x float>, float }, align 8
  %12 = alloca %"class.Raz::Vector", align 4
  %13 = alloca { <2 x float>, float }, align 8
  %14 = alloca float, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca %"class.Raz::Vector", align 4
  %18 = alloca { <2 x float>, float }, align 8
  %19 = alloca float, align 4
  %20 = alloca %"class.Raz::Vector", align 4
  %21 = alloca { <2 x float>, float }, align 8
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca %"class.Raz::Vector", align 4
  %25 = alloca %"class.Raz::Vector", align 4
  %26 = alloca { <2 x float>, float }, align 8
  %27 = alloca { <2 x float>, float }, align 8
  %28 = alloca %"class.Raz::Vector", align 4
  %29 = alloca %"class.Raz::Vector", align 4
  %30 = alloca { <2 x float>, float }, align 8
  %31 = alloca { <2 x float>, float }, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle12getSecondPosEv(ptr noundef nonnull align 8 dereferenceable(48) %33)
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getFirstPosEv(ptr noundef nonnull align 8 dereferenceable(48) %35)
  %37 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %34, ptr noundef nonnull align 4 dereferenceable(12) %36) #5
  %38 = getelementptr inbounds %"class.Raz::Vector", ptr %8, i32 0, i32 0
  %39 = getelementptr inbounds %"struct.std::array", ptr %38, i32 0, i32 0
  store { <2 x float>, float } %37, ptr %9, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 8 %9, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getThirdPosEv(ptr noundef nonnull align 8 dereferenceable(48) %40)
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getFirstPosEv(ptr noundef nonnull align 8 dereferenceable(48) %42)
  %44 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %41, ptr noundef nonnull align 4 dereferenceable(12) %43) #5
  %45 = getelementptr inbounds %"class.Raz::Vector", ptr %10, i32 0, i32 0
  %46 = getelementptr inbounds %"struct.std::array", ptr %45, i32 0, i32 0
  store { <2 x float>, float } %44, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 8 %11, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  %47 = getelementptr inbounds %"class.Raz::Ray", ptr %32, i32 0, i32 1
  %48 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE5crossERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %47, ptr noundef nonnull align 4 dereferenceable(12) %10) #5
  %49 = getelementptr inbounds %"class.Raz::Vector", ptr %12, i32 0, i32 0
  %50 = getelementptr inbounds %"struct.std::array", ptr %49, i32 0, i32 0
  store { <2 x float>, float } %48, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %50, ptr align 8 %13, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %51 = call noundef float @_ZNK3Raz6VectorIfLm3EE3dotIfEET_RKS1_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %12) #5
  store float %51, ptr %14, align 4, !tbaa !9
  %52 = load float, ptr %14, align 4, !tbaa !9
  %53 = call noundef float @_ZSt3absf(float noundef %52)
  %54 = call noundef float @_ZNSt14numeric_limitsIfE7epsilonEv() #5
  %55 = call noundef zeroext i1 @_ZN3Raz10FloatUtils14areNearlyEqualIffEEbT_S2_T0_(float noundef %53, float noundef 0.000000e+00, float noundef %54) #5
  br i1 %55, label %56, label %57

56:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %128

57:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %58 = load float, ptr %14, align 4, !tbaa !9
  %59 = fdiv float 1.000000e+00, %58
  store float %59, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #5
  %60 = getelementptr inbounds %"class.Raz::Ray", ptr %32, i32 0, i32 0
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getFirstPosEv(ptr noundef nonnull align 8 dereferenceable(48) %61)
  %63 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %60, ptr noundef nonnull align 4 dereferenceable(12) %62) #5
  %64 = getelementptr inbounds %"class.Raz::Vector", ptr %17, i32 0, i32 0
  %65 = getelementptr inbounds %"struct.std::array", ptr %64, i32 0, i32 0
  store { <2 x float>, float } %63, ptr %18, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %65, ptr align 8 %18, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %66 = call noundef float @_ZNK3Raz6VectorIfLm3EE3dotIfEET_RKS1_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %12) #5
  %67 = load float, ptr %16, align 4, !tbaa !9
  %68 = fmul float %66, %67
  store float %68, ptr %19, align 4, !tbaa !9
  %69 = load float, ptr %19, align 4, !tbaa !9
  %70 = fcmp olt float %69, 0.000000e+00
  br i1 %70, label %74, label %71

71:                                               ; preds = %57
  %72 = load float, ptr %19, align 4, !tbaa !9
  %73 = fcmp ogt float %72, 1.000000e+00
  br i1 %73, label %74, label %75

74:                                               ; preds = %71, %57
  store i1 false, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %127

75:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #5
  %76 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE5crossERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %8) #5
  %77 = getelementptr inbounds %"class.Raz::Vector", ptr %20, i32 0, i32 0
  %78 = getelementptr inbounds %"struct.std::array", ptr %77, i32 0, i32 0
  store { <2 x float>, float } %76, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 8 %21, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %79 = getelementptr inbounds %"class.Raz::Ray", ptr %32, i32 0, i32 1
  %80 = call noundef float @_ZNK3Raz6VectorIfLm3EE3dotIfEET_RKS1_(ptr noundef nonnull align 4 dereferenceable(12) %20, ptr noundef nonnull align 4 dereferenceable(12) %79) #5
  %81 = load float, ptr %16, align 4, !tbaa !9
  %82 = fmul float %80, %81
  store float %82, ptr %22, align 4, !tbaa !9
  %83 = load float, ptr %22, align 4, !tbaa !9
  %84 = fcmp olt float %83, 0.000000e+00
  br i1 %84, label %90, label %85

85:                                               ; preds = %75
  %86 = load float, ptr %19, align 4, !tbaa !9
  %87 = load float, ptr %22, align 4, !tbaa !9
  %88 = fadd float %86, %87
  %89 = fcmp ogt float %88, 1.000000e+00
  br i1 %89, label %90, label %91

90:                                               ; preds = %85, %75
  store i1 false, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %126

91:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %92 = call noundef float @_ZNK3Raz6VectorIfLm3EE3dotIfEET_RKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %20) #5
  %93 = load float, ptr %16, align 4, !tbaa !9
  %94 = fmul float %92, %93
  store float %94, ptr %23, align 4, !tbaa !9
  %95 = load float, ptr %23, align 4, !tbaa !9
  %96 = fcmp ole float %95, 0.000000e+00
  br i1 %96, label %97, label %98

97:                                               ; preds = %91
  store i1 false, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %125

98:                                               ; preds = %91
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %124

101:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #5
  %102 = getelementptr inbounds %"class.Raz::Ray", ptr %32, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #5
  %103 = getelementptr inbounds %"class.Raz::Ray", ptr %32, i32 0, i32 1
  %104 = load float, ptr %23, align 4, !tbaa !9
  %105 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmlEf(ptr noundef nonnull align 4 dereferenceable(12) %103, float noundef %104) #5
  %106 = getelementptr inbounds %"class.Raz::Vector", ptr %25, i32 0, i32 0
  %107 = getelementptr inbounds %"struct.std::array", ptr %106, i32 0, i32 0
  store { <2 x float>, float } %105, ptr %26, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %107, ptr align 8 %26, i64 12, i1 false)
  %108 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEplERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %102, ptr noundef nonnull align 4 dereferenceable(12) %25) #5
  %109 = getelementptr inbounds %"class.Raz::Vector", ptr %24, i32 0, i32 0
  %110 = getelementptr inbounds %"struct.std::array", ptr %109, i32 0, i32 0
  store { <2 x float>, float } %108, ptr %27, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %110, ptr align 8 %27, i64 12, i1 false)
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.Raz::RayHit", ptr %111, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %112, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #5
  %113 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE5crossERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %10) #5
  %114 = getelementptr inbounds %"class.Raz::Vector", ptr %29, i32 0, i32 0
  %115 = getelementptr inbounds %"struct.std::array", ptr %114, i32 0, i32 0
  store { <2 x float>, float } %113, ptr %30, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %115, ptr align 8 %30, i64 12, i1 false)
  %116 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE9normalizeIfEENS0_IT_Lm3EEEv(ptr noundef nonnull align 4 dereferenceable(12) %29) #5
  %117 = getelementptr inbounds %"class.Raz::Vector", ptr %28, i32 0, i32 0
  %118 = getelementptr inbounds %"struct.std::array", ptr %117, i32 0, i32 0
  store { <2 x float>, float } %116, ptr %31, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %118, ptr align 8 %31, i64 12, i1 false)
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.Raz::RayHit", ptr %119, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %120, ptr align 4 %28, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #5
  %121 = load float, ptr %23, align 4, !tbaa !9
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.Raz::RayHit", ptr %122, i32 0, i32 2
  store float %121, ptr %123, align 4, !tbaa !13
  br label %124

124:                                              ; preds = %101, %98
  store i1 true, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %125

125:                                              ; preds = %124, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %126

126:                                              ; preds = %125, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #5
  br label %127

127:                                              ; preds = %126, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %128

128:                                              ; preds = %127, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #5
  %129 = load i1, ptr %4, align 1
  ret i1 %129
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE5crossERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) #4

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 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 = { 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 = !{i64 0, i64 12, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !10, i64 24}
!14 = !{!"_ZTSN3Raz6RayHitE", !15, i64 0, !15, i64 12, !10, i64 24}
!15 = !{!"_ZTSN3Raz6VectorIfLm3EEE", !16, i64 0}
!16 = !{!"_ZTSSt5arrayIfLm3EE", !7, i64 0}


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

%"class.Raz::Vector" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x float] }

; 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 nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE9normalizeIfEENS0_IT_Lm3EEEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3Raz10FloatUtils14areNearlyEqualIffEEbT_S2_T0_(float noundef, float noundef, float noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNSt14numeric_limitsIfE7epsilonEv() local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEplERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmlEf(ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_8TriangleEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef writeonly %2) local_unnamed_addr #2 align 2 {
  %4 = alloca %"class.Raz::Vector", align 8
  %5 = alloca %"class.Raz::Vector", align 8
  %6 = alloca %"class.Raz::Vector", align 8
  %7 = alloca %"class.Raz::Vector", align 8
  %8 = alloca %"class.Raz::Vector", align 8
  %9 = alloca %"class.Raz::Vector", align 8
  %10 = alloca %"class.Raz::Vector", align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #4
  %11 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle12getSecondPosEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %12 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getFirstPosEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %13 = tail call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %12) #4
  %.fca.0.extract45 = extractvalue { <2 x float>, float } %13, 0
  %.fca.1.extract46 = extractvalue { <2 x float>, float } %13, 1
  store <2 x float> %.fca.0.extract45, ptr %4, align 8
  %.sroa.248.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store float %.fca.1.extract46, ptr %.sroa.248.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #4
  %14 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getThirdPosEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %15 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getFirstPosEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %16 = tail call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %15) #4
  %.fca.0.extract41 = extractvalue { <2 x float>, float } %16, 0
  %.fca.1.extract42 = extractvalue { <2 x float>, float } %16, 1
  store <2 x float> %.fca.0.extract41, ptr %5, align 8
  %.sroa.244.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  store float %.fca.1.extract42, ptr %.sroa.244.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #4
  %17 = getelementptr inbounds i8, ptr %0, i64 12
  %18 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE5crossERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %5) #4
  %.fca.0.extract37 = extractvalue { <2 x float>, float } %18, 0
  %.fca.1.extract38 = extractvalue { <2 x float>, float } %18, 1
  store <2 x float> %.fca.0.extract37, ptr %6, align 8
  %.sroa.240.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  store float %.fca.1.extract38, ptr %.sroa.240.0..sroa_idx, align 8
  %19 = call noundef float @_ZNK3Raz6VectorIfLm3EE3dotIfEET_RKS1_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %6) #4
  %20 = call noundef float @_ZSt3absf(float noundef %19)
  %21 = call noundef float @_ZNSt14numeric_limitsIfE7epsilonEv() #4
  %22 = call noundef zeroext i1 @_ZN3Raz10FloatUtils14areNearlyEqualIffEEbT_S2_T0_(float noundef %20, float noundef 0.000000e+00, float noundef %21) #4
  br i1 %22, label %51, label %23

23:                                               ; preds = %3
  %24 = fdiv float 1.000000e+00, %19
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #4
  %25 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getFirstPosEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %26 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %25) #4
  %.fca.0.extract28 = extractvalue { <2 x float>, float } %26, 0
  %.fca.1.extract29 = extractvalue { <2 x float>, float } %26, 1
  store <2 x float> %.fca.0.extract28, ptr %7, align 8
  %.sroa.231.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store float %.fca.1.extract29, ptr %.sroa.231.0..sroa_idx, align 8
  %27 = call noundef float @_ZNK3Raz6VectorIfLm3EE3dotIfEET_RKS1_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %6) #4
  %28 = fmul float %24, %27
  %29 = fcmp olt float %28, 0.000000e+00
  %30 = fcmp ogt float %28, 1.000000e+00
  %or.cond = or i1 %29, %30
  br i1 %or.cond, label %50, label %31

31:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #4
  %32 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE5crossERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %4) #4
  %.fca.0.extract21 = extractvalue { <2 x float>, float } %32, 0
  %.fca.1.extract22 = extractvalue { <2 x float>, float } %32, 1
  store <2 x float> %.fca.0.extract21, ptr %8, align 8
  %.sroa.224.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  store float %.fca.1.extract22, ptr %.sroa.224.0..sroa_idx, align 8
  %33 = call noundef float @_ZNK3Raz6VectorIfLm3EE3dotIfEET_RKS1_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %17) #4
  %34 = fmul float %24, %33
  %35 = fcmp olt float %34, 0.000000e+00
  %36 = fadd float %28, %34
  %37 = fcmp ogt float %36, 1.000000e+00
  %or.cond65 = or i1 %35, %37
  br i1 %or.cond65, label %49, label %38

38:                                               ; preds = %31
  %39 = call noundef float @_ZNK3Raz6VectorIfLm3EE3dotIfEET_RKS1_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %8) #4
  %40 = fmul float %24, %39
  %41 = fcmp ugt float %40, 0.000000e+00
  %.not = icmp ne ptr %2, null
  %or.cond67.not = and i1 %.not, %41
  br i1 %or.cond67.not, label %42, label %49

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  %43 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmlEf(ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef %40) #4
  %.fca.0.extract11 = extractvalue { <2 x float>, float } %43, 0
  %.fca.1.extract12 = extractvalue { <2 x float>, float } %43, 1
  store <2 x float> %.fca.0.extract11, ptr %9, align 8
  %.sroa.214.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  store float %.fca.1.extract12, ptr %.sroa.214.0..sroa_idx, align 8
  %44 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEplERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %9) #4
  %.fca.0.extract7 = extractvalue { <2 x float>, float } %44, 0
  %.fca.1.extract8 = extractvalue { <2 x float>, float } %44, 1
  store <2 x float> %.fca.0.extract7, ptr %2, align 4
  %.sroa.416.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  store float %.fca.1.extract8, ptr %.sroa.416.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  %45 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE5crossERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5) #4
  %.fca.0.extract2 = extractvalue { <2 x float>, float } %45, 0
  %.fca.1.extract3 = extractvalue { <2 x float>, float } %45, 1
  store <2 x float> %.fca.0.extract2, ptr %10, align 8
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  store float %.fca.1.extract3, ptr %.sroa.25.0..sroa_idx, align 8
  %46 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE9normalizeIfEENS0_IT_Lm3EEEv(ptr noundef nonnull align 4 dereferenceable(12) %10) #4
  %.fca.0.extract = extractvalue { <2 x float>, float } %46, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %46, 1
  %47 = getelementptr inbounds i8, ptr %2, i64 12
  store <2 x float> %.fca.0.extract, ptr %47, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 20
  store float %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  %48 = getelementptr inbounds i8, ptr %2, i64 24
  store float %40, ptr %48, align 4, !tbaa !8
  br label %49

49:                                               ; preds = %38, %42, %31
  %.1 = phi i1 [ false, %31 ], [ true, %42 ], [ %41, %38 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #4
  br label %50

50:                                               ; preds = %23, %49
  %.2 = phi i1 [ %.1, %49 ], [ false, %23 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #4
  br label %51

51:                                               ; preds = %3, %50
  %.3 = phi i1 [ %.2, %50 ], [ false, %3 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #4
  ret i1 %.3
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle12getSecondPosEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getFirstPosEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz8Triangle11getThirdPosEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EE5crossERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 = { inlinehint 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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !12, i64 24}
!9 = !{!"_ZTSN3Raz6RayHitE", !10, i64 0, !10, i64 12, !12, i64 24}
!10 = !{!"_ZTSN3Raz6VectorIfLm3EEE", !11, i64 0}
!11 = !{!"_ZTSSt5arrayIfLm3EE", !6, i64 0}
!12 = !{!"float", !6, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass