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

; 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::ConvexMesh" = type { ptr, ptr, ptr, ptr, i16, i16, i16, i16, %"class.std::vector", %"class.Maths::TAABB3" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"struct.Riemann::ConvexMeshFace" = type { %"class.Riemann::Plane3", i16, i8, i8 }
%"class.Riemann::Plane3" = type { %"class.Maths::TVector3", float }

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

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

; 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)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann10ConvexMesh7GetMeshERSt6vectorIN5Maths8TVector3IfEESaIS4_EERS1_ItSaItEES7_(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca i16, align 2
  %11 = alloca %"class.Maths::TVector3", align 4
  %12 = alloca i16, align 2
  %13 = alloca %"class.Maths::TVector3", align 4
  %14 = alloca %"class.Maths::TVector3", align 4
  %15 = alloca i16, align 2
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i8, align 1
  %19 = alloca i16, align 2
  %20 = alloca i16, align 2
  %21 = alloca i16, align 2
  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
  store ptr %3, ptr %8, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8
  %23 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 4
  %24 = load i16, ptr %23, align 8, !tbaa !9
  %25 = zext i16 %24 to i32
  %26 = icmp slt i32 %25, 3
  br i1 %26, label %27, label %28

27:                                               ; preds = %4
  br label %148

28:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %9)
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #4
  store i16 0, ptr %10, align 2, !tbaa !19
  br label %29

29:                                               ; preds = %43, %28
  %30 = load i16, ptr %10, align 2, !tbaa !19
  %31 = zext i16 %30 to i32
  %32 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 4
  %33 = load i16, ptr %32, align 8, !tbaa !9
  %34 = zext i16 %33 to i32
  %35 = icmp slt i32 %31, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #4
  br label %46

37:                                               ; preds = %29
  %38 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = load i16, ptr %10, align 2, !tbaa !19
  %41 = zext i16 %40 to i64
  %42 = getelementptr inbounds %"class.Maths::TVector3", ptr %39, i64 %41
  call void @_ZN5Maths8TVector3IfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %42)
  br label %43

43:                                               ; preds = %37
  %44 = load i16, ptr %10, align 2, !tbaa !19
  %45 = add i16 %44, 1
  store i16 %45, ptr %10, align 2, !tbaa !19
  br label %29, !llvm.loop !21

46:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #4
  %47 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 4
  %48 = load i16, ptr %47, align 8, !tbaa !9
  %49 = uitofp i16 %48 to float
  call void @_ZNK5Maths8TVector3IfEdvEf(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef %49)
  %50 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #4
  store i16 0, ptr %12, align 2, !tbaa !19
  br label %51

51:                                               ; preds = %72, %46
  %52 = load i16, ptr %12, align 2, !tbaa !19
  %53 = zext i16 %52 to i32
  %54 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 4
  %55 = load i16, ptr %54, align 8, !tbaa !9
  %56 = zext i16 %55 to i32
  %57 = icmp slt i32 %53, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #4
  br label %75

59:                                               ; preds = %51
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = load i16, ptr %12, align 2, !tbaa !19
  %64 = zext i16 %63 to i64
  %65 = getelementptr inbounds %"class.Maths::TVector3", ptr %62, i64 %64
  call void @_ZNSt6vectorIN5Maths8TVector3IfEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 4 dereferenceable(12) %65)
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #4
  %67 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !20
  %69 = load i16, ptr %12, align 2, !tbaa !19
  %70 = zext i16 %69 to i64
  %71 = getelementptr inbounds %"class.Maths::TVector3", ptr %68, i64 %70
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %71, ptr noundef nonnull align 4 dereferenceable(12) %9)
  call void @_ZNK5Maths8TVector3IfE4UnitEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @_ZNSt6vectorIN5Maths8TVector3IfEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %66, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #4
  br label %72

72:                                               ; preds = %59
  %73 = load i16, ptr %12, align 2, !tbaa !19
  %74 = add i16 %73, 1
  store i16 %74, ptr %12, align 2, !tbaa !19
  br label %51, !llvm.loop !23

75:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #4
  store i16 0, ptr %15, align 2, !tbaa !19
  br label %76

76:                                               ; preds = %144, %75
  %77 = load i16, ptr %15, align 2, !tbaa !19
  %78 = zext i16 %77 to i32
  %79 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 6
  %80 = load i16, ptr %79, align 4, !tbaa !24
  %81 = zext i16 %80 to i32
  %82 = icmp slt i32 %78, %81
  br i1 %82, label %84, label %83

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

84:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %85 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !25
  %87 = load i16, ptr %15, align 2, !tbaa !19
  %88 = zext i16 %87 to i64
  %89 = getelementptr inbounds %"struct.Riemann::ConvexMeshFace", ptr %86, i64 %88
  store ptr %89, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #4
  store i8 1, ptr %18, align 1, !tbaa !26
  br label %90

90:                                               ; preds = %140, %84
  %91 = load i8, ptr %18, align 1, !tbaa !26
  %92 = zext i8 %91 to i32
  %93 = load ptr, ptr %17, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.Riemann::ConvexMeshFace", ptr %93, i32 0, i32 2
  %95 = load i8, ptr %94, align 2, !tbaa !27
  %96 = zext i8 %95 to i32
  %97 = sub nsw i32 %96, 1
  %98 = icmp slt i32 %92, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %90
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #4
  br label %143

100:                                              ; preds = %90
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #4
  %102 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 3
  %103 = load ptr, ptr %102, align 8, !tbaa !30
  %104 = load ptr, ptr %17, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.Riemann::ConvexMeshFace", ptr %104, i32 0, i32 1
  %106 = load i16, ptr %105, align 4, !tbaa !31
  %107 = zext i16 %106 to i64
  %108 = getelementptr inbounds i8, ptr %103, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !26
  %110 = zext i8 %109 to i16
  store i16 %110, ptr %19, align 2, !tbaa !19
  call void @_ZNSt6vectorItSaItEE9push_backEOt(ptr noundef nonnull align 8 dereferenceable(24) %101, ptr noundef nonnull align 2 dereferenceable(2) %19)
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #4
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #4
  %112 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 3
  %113 = load ptr, ptr %112, align 8, !tbaa !30
  %114 = load ptr, ptr %17, align 8, !tbaa !5
  %115 = getelementptr inbounds %"struct.Riemann::ConvexMeshFace", ptr %114, i32 0, i32 1
  %116 = load i16, ptr %115, align 4, !tbaa !31
  %117 = zext i16 %116 to i32
  %118 = load i8, ptr %18, align 1, !tbaa !26
  %119 = zext i8 %118 to i32
  %120 = add nsw i32 %117, %119
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i8, ptr %113, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !26
  %124 = zext i8 %123 to i16
  store i16 %124, ptr %20, align 2, !tbaa !19
  call void @_ZNSt6vectorItSaItEE9push_backEOt(ptr noundef nonnull align 8 dereferenceable(24) %111, ptr noundef nonnull align 2 dereferenceable(2) %20)
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #4
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %21) #4
  %126 = getelementptr inbounds %"class.Riemann::ConvexMesh", ptr %22, i32 0, i32 3
  %127 = load ptr, ptr %126, align 8, !tbaa !30
  %128 = load ptr, ptr %17, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.Riemann::ConvexMeshFace", ptr %128, i32 0, i32 1
  %130 = load i16, ptr %129, align 4, !tbaa !31
  %131 = zext i16 %130 to i32
  %132 = load i8, ptr %18, align 1, !tbaa !26
  %133 = zext i8 %132 to i32
  %134 = add nsw i32 %131, %133
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i8, ptr %127, i64 %136
  %138 = load i8, ptr %137, align 1, !tbaa !26
  %139 = zext i8 %138 to i16
  store i16 %139, ptr %21, align 2, !tbaa !19
  call void @_ZNSt6vectorItSaItEE9push_backEOt(ptr noundef nonnull align 8 dereferenceable(24) %125, ptr noundef nonnull align 2 dereferenceable(2) %21)
  call void @llvm.lifetime.end.p0(i64 2, ptr %21) #4
  br label %140

140:                                              ; preds = %100
  %141 = load i8, ptr %18, align 1, !tbaa !26
  %142 = add i8 %141, 1
  store i8 %142, ptr %18, align 1, !tbaa !26
  br label %90, !llvm.loop !32

143:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %144

144:                                              ; preds = %143
  %145 = load i16, ptr %15, align 2, !tbaa !19
  %146 = add i16 %145, 1
  store i16 %146, ptr %15, align 2, !tbaa !19
  br label %76, !llvm.loop !33

147:                                              ; preds = %83
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #4
  br label %148

148:                                              ; preds = %147, %27
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEdvEf(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 32}
!10 = !{!"_ZTSN7Riemann10ConvexMeshE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 34, !11, i64 36, !11, i64 38, !12, i64 40, !16, i64 64}
!11 = !{!"short", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIcSaIcEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIcSaIcEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSN5Maths6TAABB3IfEE", !17, i64 0, !17, i64 12}
!17 = !{!"_ZTSN5Maths8TVector3IfEE", !18, i64 0, !18, i64 4, !18, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!11, !11, i64 0}
!20 = !{!10, !6, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!10, !11, i64 36}
!25 = !{!10, !6, i64 16}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !7, i64 18}
!28 = !{!"_ZTSN7Riemann14ConvexMeshFaceE", !29, i64 0, !11, i64 16, !7, i64 18, !7, i64 19}
!29 = !{!"_ZTSN7Riemann6Plane3E", !17, i64 0, !18, i64 12}
!30 = !{!10, !6, i64 24}
!31 = !{!28, !11, i64 16}
!32 = distinct !{!32, !22}
!33 = distinct !{!33, !22}


; 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 }
%"struct.Riemann::ConvexMeshFace" = type { %"class.Riemann::Plane3", i16, i8, i8 }
%"class.Riemann::Plane3" = type { %"class.Maths::TVector3", 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; 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 #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann10ConvexMesh7GetMeshERSt6vectorIN5Maths8TVector3IfEESaIS4_EERS1_ItSaItEES7_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %"class.Maths::TVector3", align 4
  %6 = alloca %"class.Maths::TVector3", align 4
  %7 = alloca %"class.Maths::TVector3", align 4
  %8 = alloca %"class.Maths::TVector3", align 4
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca i16, align 2
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load i16, ptr %12, align 8, !tbaa !5
  %14 = icmp ult i16 %13, 3
  br i1 %14, label %78, label %15

15:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %5)
  %16 = load i16, ptr %12, align 8, !tbaa !5
  %.not = icmp eq i16 %16, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %17 = uitofp i16 %22 to float
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %15
  %.lcssa = phi float [ 0.000000e+00, %15 ], [ %17, %._crit_edge.loopexit ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #4
  call void @_ZNK5Maths8TVector3IfEdvEf(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef %.lcssa)
  %18 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #4
  %19 = load i16, ptr %12, align 8, !tbaa !5
  %.not38 = icmp eq i16 %19, 0
  br i1 %.not38, label %.preheader, label %.lr.ph30

.lr.ph:                                           ; preds = %15, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %15 ]
  %20 = load ptr, ptr %0, align 8, !tbaa !18
  %21 = getelementptr inbounds %"class.Maths::TVector3", ptr %20, i64 %indvars.iv
  call void @_ZN5Maths8TVector3IfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i16, ptr %12, align 8, !tbaa !5
  %23 = zext i16 %22 to i64
  %24 = icmp ult i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !19

.preheader:                                       ; preds = %.lr.ph30, %._crit_edge
  %25 = getelementptr inbounds i8, ptr %0, i64 36
  %26 = load i16, ptr %25, align 4, !tbaa !21
  %.not39 = icmp eq i16 %26, 0
  br i1 %.not39, label %._crit_edge37, label %.lr.ph36

.lr.ph36:                                         ; preds = %.preheader
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = getelementptr inbounds i8, ptr %0, i64 24
  br label %36

.lr.ph30:                                         ; preds = %._crit_edge, %.lr.ph30
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %.lr.ph30 ], [ 0, %._crit_edge ]
  %29 = load ptr, ptr %0, align 8, !tbaa !18
  %30 = getelementptr inbounds %"class.Maths::TVector3", ptr %29, i64 %indvars.iv42
  call void @_ZNSt6vectorIN5Maths8TVector3IfEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(12) %30)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #4
  %31 = load ptr, ptr %0, align 8, !tbaa !18
  %32 = getelementptr inbounds %"class.Maths::TVector3", ptr %31, i64 %indvars.iv42
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %32, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @_ZNK5Maths8TVector3IfE4UnitEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @_ZNSt6vectorIN5Maths8TVector3IfEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #4
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %33 = load i16, ptr %12, align 8, !tbaa !5
  %34 = zext i16 %33 to i64
  %35 = icmp ult i64 %indvars.iv.next43, %34
  br i1 %35, label %.lr.ph30, label %.preheader, !llvm.loop !22

._crit_edge37:                                    ; preds = %._crit_edge34, %.preheader
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #4
  br label %78

36:                                               ; preds = %.lr.ph36, %._crit_edge34
  %37 = phi i16 [ %26, %.lr.ph36 ], [ %44, %._crit_edge34 ]
  %indvars.iv45 = phi i64 [ 0, %.lr.ph36 ], [ %indvars.iv.next46, %._crit_edge34 ]
  %38 = load ptr, ptr %27, align 8, !tbaa !23
  %39 = getelementptr inbounds %"struct.Riemann::ConvexMeshFace", ptr %38, i64 %indvars.iv45
  %40 = getelementptr inbounds i8, ptr %39, i64 18
  %41 = load i8, ptr %40, align 2, !tbaa !24
  %42 = icmp ugt i8 %41, 2
  br i1 %42, label %.lr.ph33, label %._crit_edge34

.lr.ph33:                                         ; preds = %36
  %43 = getelementptr inbounds i8, ptr %39, i64 16
  br label %47

._crit_edge34.loopexit:                           ; preds = %47
  %.pre = load i16, ptr %25, align 4, !tbaa !21
  br label %._crit_edge34

._crit_edge34:                                    ; preds = %._crit_edge34.loopexit, %36
  %44 = phi i16 [ %.pre, %._crit_edge34.loopexit ], [ %37, %36 ]
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %45 = zext i16 %44 to i64
  %46 = icmp ult i64 %indvars.iv.next46, %45
  br i1 %46, label %36, label %._crit_edge37, !llvm.loop !27

47:                                               ; preds = %.lr.ph33, %47
  %48 = phi i32 [ 1, %.lr.ph33 ], [ %73, %47 ]
  %.031 = phi i8 [ 1, %.lr.ph33 ], [ %72, %47 ]
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #4
  %49 = load ptr, ptr %28, align 8, !tbaa !28
  %50 = load i16, ptr %43, align 4, !tbaa !29
  %51 = zext i16 %50 to i64
  %52 = getelementptr inbounds i8, ptr %49, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !30
  %54 = zext i8 %53 to i16
  store i16 %54, ptr %9, align 2, !tbaa !31
  call void @_ZNSt6vectorItSaItEE9push_backEOt(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 2 dereferenceable(2) %9)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %10) #4
  %55 = load ptr, ptr %28, align 8, !tbaa !28
  %56 = load i16, ptr %43, align 4, !tbaa !29
  %57 = zext i16 %56 to i32
  %58 = add nuw nsw i32 %48, %57
  %59 = zext nneg i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %55, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !30
  %62 = zext i8 %61 to i16
  store i16 %62, ptr %10, align 2, !tbaa !31
  call void @_ZNSt6vectorItSaItEE9push_backEOt(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 2 dereferenceable(2) %10)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %11) #4
  %63 = load ptr, ptr %28, align 8, !tbaa !28
  %64 = load i16, ptr %43, align 4, !tbaa !29
  %65 = zext i16 %64 to i32
  %66 = add nuw nsw i32 %48, %65
  %67 = zext nneg i32 %66 to i64
  %68 = getelementptr inbounds i8, ptr %63, i64 %67
  %69 = getelementptr inbounds i8, ptr %68, i64 1
  %70 = load i8, ptr %69, align 1, !tbaa !30
  %71 = zext i8 %70 to i16
  store i16 %71, ptr %11, align 2, !tbaa !31
  call void @_ZNSt6vectorItSaItEE9push_backEOt(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 2 dereferenceable(2) %11)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %11) #4
  %72 = add nuw i8 %.031, 1
  %73 = zext i8 %72 to i32
  %74 = load i8, ptr %40, align 2, !tbaa !24
  %75 = zext i8 %74 to i32
  %76 = add nsw i32 %75, -1
  %77 = icmp sgt i32 %76, %73
  br i1 %77, label %47, label %._crit_edge34.loopexit, !llvm.loop !32

78:                                               ; preds = %4, %._crit_edge37
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEdvEf(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5Maths8TVector3IfEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5Maths8TVector3IfEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorItSaItEE9push_backEOt(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #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, !10, i64 32}
!6 = !{!"_ZTSN7Riemann10ConvexMeshE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 34, !10, i64 36, !10, i64 38, !11, i64 40, !15, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIcSaIcEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIcSaIcEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!"_ZTSN5Maths6TAABB3IfEE", !16, i64 0, !16, i64 12}
!16 = !{!"_ZTSN5Maths8TVector3IfEE", !17, i64 0, !17, i64 4, !17, i64 8}
!17 = !{!"float", !8, i64 0}
!18 = !{!6, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!6, !10, i64 36}
!22 = distinct !{!22, !20}
!23 = !{!6, !7, i64 16}
!24 = !{!25, !8, i64 18}
!25 = !{!"_ZTSN7Riemann14ConvexMeshFaceE", !26, i64 0, !10, i64 16, !8, i64 18, !8, i64 19}
!26 = !{!"_ZTSN7Riemann6Plane3E", !16, i64 0, !17, i64 12}
!27 = distinct !{!27, !20}
!28 = !{!6, !7, i64 24}
!29 = !{!25, !10, i64 16}
!30 = !{!8, !8, i64 0}
!31 = !{!10, !10, i64 0}
!32 = distinct !{!32, !20}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass