; LLVM IR from atlantis13579/Riemann :: Src/CollisionPrimitive (Cylinder3)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.Maths::TVector3" = type { float, float, float }
%"class.Riemann::Cylinder3" = type { float, float, %"class.Maths::TVector3", %"class.Maths::TVector3" }

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

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

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

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

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

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK7Riemann9Cylinder314GetSupportFaceERKN5Maths8TVector3IfEEPS3_(ptr noundef nonnull align 4 dereferenceable(32) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %2) #4 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca %"class.Maths::TVector3", align 4
  %12 = alloca %"class.Maths::TVector3", align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca %"class.Maths::TVector3", align 4
  %16 = alloca i64, align 8
  %17 = alloca %"class.Maths::TVector3", align 4
  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
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %19 = call noundef nonnull align 4 dereferenceable(96) ptr @_ZN7Riemann9Cylinder316GetCylinderFacesEv()
  store ptr %19, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %20 = getelementptr inbounds %"class.Riemann::Cylinder3", ptr %18, i32 0, i32 1
  %21 = load float, ptr %20, align 4, !tbaa !9
  %22 = fmul float %21, 5.000000e-01
  store float %22, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %"class.Maths::TVector3", ptr %23, i32 0, i32 0
  %25 = load float, ptr %24, align 4, !tbaa !14
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.Maths::TVector3", ptr %26, i32 0, i32 0
  %28 = load float, ptr %27, align 4, !tbaa !14
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.Maths::TVector3", ptr %29, i32 0, i32 2
  %31 = load float, ptr %30, align 4, !tbaa !15
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.Maths::TVector3", ptr %32, i32 0, i32 2
  %34 = load float, ptr %33, align 4, !tbaa !15
  %35 = fmul float %31, %34
  %36 = call float @llvm.fmuladd.f32(float %25, float %28, float %35)
  %37 = call float @sqrtf(float noundef %36) #7
  store float %37, ptr %10, align 4, !tbaa !13
  %38 = load float, ptr %10, align 4, !tbaa !13
  %39 = load float, ptr %9, align 4, !tbaa !13
  %40 = fmul float %38, %39
  %41 = getelementptr inbounds %"class.Riemann::Cylinder3", ptr %18, i32 0, i32 0
  %42 = load float, ptr %41, align 4, !tbaa !16
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %"class.Maths::TVector3", ptr %43, i32 0, i32 1
  %45 = load float, ptr %44, align 4, !tbaa !17
  %46 = call float @llvm.fabs.f32(float %45)
  %47 = fmul float %42, %46
  %48 = fcmp ogt float %40, %47
  br i1 %48, label %49, label %95

49:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #7
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %"class.Maths::TVector3", ptr %50, i32 0, i32 0
  %52 = load float, ptr %51, align 4, !tbaa !14
  %53 = fneg float %52
  %54 = getelementptr inbounds %"class.Riemann::Cylinder3", ptr %18, i32 0, i32 0
  %55 = load float, ptr %54, align 4, !tbaa !16
  %56 = fmul float %53, %55
  %57 = load float, ptr %10, align 4, !tbaa !13
  %58 = fdiv float %56, %57
  %59 = load float, ptr %9, align 4, !tbaa !13
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %"class.Maths::TVector3", ptr %60, i32 0, i32 2
  %62 = load float, ptr %61, align 4, !tbaa !15
  %63 = fneg float %62
  %64 = getelementptr inbounds %"class.Riemann::Cylinder3", ptr %18, i32 0, i32 0
  %65 = load float, ptr %64, align 4, !tbaa !16
  %66 = fmul float %63, %65
  %67 = load float, ptr %10, align 4, !tbaa !13
  %68 = fdiv float %66, %67
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %11, float noundef %58, float noundef %59, float noundef %68)
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %"class.Maths::TVector3", ptr %69, i64 0
  %71 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %70, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #7
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %"class.Maths::TVector3", ptr %72, i32 0, i32 0
  %74 = load float, ptr %73, align 4, !tbaa !14
  %75 = fneg float %74
  %76 = getelementptr inbounds %"class.Riemann::Cylinder3", ptr %18, i32 0, i32 0
  %77 = load float, ptr %76, align 4, !tbaa !16
  %78 = fmul float %75, %77
  %79 = load float, ptr %10, align 4, !tbaa !13
  %80 = fdiv float %78, %79
  %81 = load float, ptr %9, align 4, !tbaa !13
  %82 = fneg float %81
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.Maths::TVector3", ptr %83, i32 0, i32 2
  %85 = load float, ptr %84, align 4, !tbaa !15
  %86 = fneg float %85
  %87 = getelementptr inbounds %"class.Riemann::Cylinder3", ptr %18, i32 0, i32 0
  %88 = load float, ptr %87, align 4, !tbaa !16
  %89 = fmul float %86, %88
  %90 = load float, ptr %10, align 4, !tbaa !13
  %91 = fdiv float %89, %90
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef %80, float noundef %82, float noundef %91)
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.Maths::TVector3", ptr %92, i64 1
  %94 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %93, ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  store i32 2, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %151

95:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %"class.Maths::TVector3", ptr %96, i32 0, i32 1
  %98 = load float, ptr %97, align 4, !tbaa !17
  %99 = fcmp ogt float %98, 0.000000e+00
  %100 = zext i1 %99 to i64
  %101 = select i1 %99, float 1.000000e+00, float -1.000000e+00
  store float %101, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #7
  %102 = getelementptr inbounds %"class.Riemann::Cylinder3", ptr %18, i32 0, i32 0
  %103 = load float, ptr %102, align 4, !tbaa !16
  %104 = load float, ptr %9, align 4, !tbaa !13
  %105 = load float, ptr %14, align 4, !tbaa !13
  %106 = fmul float %104, %105
  %107 = getelementptr inbounds %"class.Riemann::Cylinder3", ptr %18, i32 0, i32 0
  %108 = load float, ptr %107, align 4, !tbaa !16
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %15, float noundef %103, float noundef %106, float noundef %108)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !18
  br label %109

109:                                              ; preds = %144, %95
  %110 = load i64, ptr %16, align 8, !tbaa !18
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = call noundef i64 @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(96) %111) #8
  %113 = icmp ult i64 %110, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %109
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %147

115:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = load i64, ptr %16, align 8, !tbaa !18
  %118 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EEixEm(ptr noundef nonnull align 4 dereferenceable(96) %116, i64 noundef %117) #7
  %119 = getelementptr inbounds %"class.Maths::TVector3", ptr %118, i32 0, i32 0
  %120 = load float, ptr %119, align 4, !tbaa !14
  %121 = getelementptr inbounds %"class.Maths::TVector3", ptr %15, i32 0, i32 0
  %122 = load float, ptr %121, align 4, !tbaa !14
  %123 = fmul float %120, %122
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = load i64, ptr %16, align 8, !tbaa !18
  %126 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EEixEm(ptr noundef nonnull align 4 dereferenceable(96) %124, i64 noundef %125) #7
  %127 = getelementptr inbounds %"class.Maths::TVector3", ptr %126, i32 0, i32 1
  %128 = load float, ptr %127, align 4, !tbaa !17
  %129 = getelementptr inbounds %"class.Maths::TVector3", ptr %15, i32 0, i32 1
  %130 = load float, ptr %129, align 4, !tbaa !17
  %131 = fmul float %128, %130
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = load i64, ptr %16, align 8, !tbaa !18
  %134 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EEixEm(ptr noundef nonnull align 4 dereferenceable(96) %132, i64 noundef %133) #7
  %135 = getelementptr inbounds %"class.Maths::TVector3", ptr %134, i32 0, i32 2
  %136 = load float, ptr %135, align 4, !tbaa !15
  %137 = getelementptr inbounds %"class.Maths::TVector3", ptr %15, i32 0, i32 2
  %138 = load float, ptr %137, align 4, !tbaa !15
  %139 = fmul float %136, %138
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef %123, float noundef %131, float noundef %139)
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = load i64, ptr %16, align 8, !tbaa !18
  %142 = getelementptr inbounds %"class.Maths::TVector3", ptr %140, i64 %141
  %143 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %142, ptr noundef nonnull align 4 dereferenceable(12) %17)
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  br label %144

144:                                              ; preds = %115
  %145 = load i64, ptr %16, align 8, !tbaa !18
  %146 = add i64 %145, 1
  store i64 %146, ptr %16, align 8, !tbaa !18
  br label %109, !llvm.loop !20

147:                                              ; preds = %114
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = call noundef i64 @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(96) %148) #8
  %150 = trunc i64 %149 to i32
  store i32 %150, ptr %4, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %151

151:                                              ; preds = %147, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %152 = load i32, ptr %4, align 4
  ret i32 %152
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(96) ptr @_ZN7Riemann9Cylinder316GetCylinderFacesEv() #4 align 2

; Function Attrs: mustprogress nounwind willreturn memory(none) uwtable
declare dso_local noundef i64 @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(96)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EEixEm(ptr noundef nonnull align 4 dereferenceable(96), i64 noundef) #6 align 2

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

!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 4}
!10 = !{!"_ZTSN7Riemann9Cylinder3E", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 20}
!11 = !{!"float", !7, i64 0}
!12 = !{!"_ZTSN5Maths8TVector3IfEE", !11, i64 0, !11, i64 4, !11, i64 8}
!13 = !{!11, !11, i64 0}
!14 = !{!12, !11, i64 0}
!15 = !{!12, !11, i64 8}
!16 = !{!10, !11, i64 0}
!17 = !{!12, !11, i64 4}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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"

%"class.Maths::TVector3" = type { float, float, float }

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK7Riemann9Cylinder314GetSupportFaceERKN5Maths8TVector3IfEEPS3_(ptr nocapture noundef nonnull readonly align 4 dereferenceable(32) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(12) %1, ptr noundef %2) local_unnamed_addr #3 align 2 {
  %4 = alloca %"class.Maths::TVector3", align 4
  %5 = alloca %"class.Maths::TVector3", align 4
  %6 = alloca %"class.Maths::TVector3", align 4
  %7 = alloca %"class.Maths::TVector3", align 4
  %8 = tail call noundef nonnull align 4 dereferenceable(96) ptr @_ZN7Riemann9Cylinder316GetCylinderFacesEv()
  %9 = load float, ptr %1, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load float, ptr %10, align 4, !tbaa !10
  %12 = fmul float %11, %11
  %13 = tail call float @llvm.fmuladd.f32(float %9, float %9, float %12)
  %sqrt = tail call float @llvm.sqrt.f32(float %13)
  %14 = getelementptr inbounds i8, ptr %1, i64 4
  %15 = load float, ptr %14, align 4, !tbaa !11
  %16 = tail call float @llvm.fabs.f32(float %15)
  %17 = load <2 x float>, ptr %0, align 4, !tbaa !12
  %18 = insertelement <2 x float> <float poison, float 5.000000e-01>, float %16, i64 0
  %19 = fmul <2 x float> %17, %18
  %20 = extractelement <2 x float> %19, i64 1
  %21 = fmul float %20, %sqrt
  %22 = extractelement <2 x float> %19, i64 0
  %23 = fcmp ogt float %21, %22
  br i1 %23, label %24, label %45

24:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  %25 = fneg float %9
  %26 = extractelement <2 x float> %17, i64 0
  %27 = fmul float %26, %25
  %28 = fdiv float %27, %sqrt
  %29 = fneg float %11
  %30 = fmul float %26, %29
  %31 = fdiv float %30, %sqrt
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef %28, float noundef %20, float noundef %31)
  %32 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  %33 = load float, ptr %1, align 4, !tbaa !5
  %34 = fneg float %33
  %35 = load float, ptr %0, align 4, !tbaa !13
  %36 = fmul float %35, %34
  %37 = fdiv float %36, %sqrt
  %38 = fneg float %20
  %39 = load float, ptr %10, align 4, !tbaa !10
  %40 = fneg float %39
  %41 = fmul float %35, %40
  %42 = fdiv float %41, %sqrt
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef %37, float noundef %38, float noundef %42)
  %43 = getelementptr inbounds i8, ptr %2, i64 12
  %44 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %43, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %72

45:                                               ; preds = %3
  %46 = fcmp ogt float %15, 0.000000e+00
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #7
  %47 = fneg float %20
  %48 = select i1 %46, float %20, float %47
  %49 = extractelement <2 x float> %17, i64 0
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef %49, float noundef %48, float noundef %49)
  %50 = call noundef i64 @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(96) %8) #8
  %.not = icmp eq i64 %50, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %45
  %51 = getelementptr inbounds i8, ptr %6, i64 4
  %52 = getelementptr inbounds i8, ptr %6, i64 8
  br label %54

._crit_edge:                                      ; preds = %54, %45
  %53 = trunc i64 %50 to i32
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  br label %72

54:                                               ; preds = %.lr.ph, %54
  %.037 = phi i64 [ 0, %.lr.ph ], [ %71, %54 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EEixEm(ptr noundef nonnull align 4 dereferenceable(96) %8, i64 noundef %.037) #7
  %56 = load float, ptr %55, align 4, !tbaa !5
  %57 = load float, ptr %6, align 4, !tbaa !5
  %58 = fmul float %56, %57
  %59 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EEixEm(ptr noundef nonnull align 4 dereferenceable(96) %8, i64 noundef %.037) #7
  %60 = getelementptr inbounds i8, ptr %59, i64 4
  %61 = load float, ptr %60, align 4, !tbaa !11
  %62 = load float, ptr %51, align 4, !tbaa !11
  %63 = fmul float %61, %62
  %64 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EEixEm(ptr noundef nonnull align 4 dereferenceable(96) %8, i64 noundef %.037) #7
  %65 = getelementptr inbounds i8, ptr %64, i64 8
  %66 = load float, ptr %65, align 4, !tbaa !10
  %67 = load float, ptr %52, align 4, !tbaa !10
  %68 = fmul float %66, %67
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef %58, float noundef %63, float noundef %68)
  %69 = getelementptr inbounds %"class.Maths::TVector3", ptr %2, i64 %.037
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %69, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  %71 = add nuw i64 %.037, 1
  %exitcond.not = icmp eq i64 %71, %50
  br i1 %exitcond.not, label %._crit_edge, label %54, !llvm.loop !15

72:                                               ; preds = %._crit_edge, %24
  %.035 = phi i32 [ 2, %24 ], [ %53, %._crit_edge ]
  ret i32 %.035
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(96) ptr @_ZN7Riemann9Cylinder316GetCylinderFacesEv() local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare dso_local noundef i64 @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(96)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt5arrayIN5Maths8TVector3IfEELm8EEixEm(ptr noundef nonnull align 4 dereferenceable(96), i64 noundef) local_unnamed_addr #5 align 2

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

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

!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 = !{!"_ZTSN5Maths8TVector3IfEE", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 4}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !7, i64 0}
!14 = !{!"_ZTSN7Riemann9Cylinder3E", !7, i64 0, !7, i64 4, !6, i64 8, !6, i64 20}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass