; LLVM IR from atlantis13579/Riemann :: Src/Geometry (Polygon3)

; 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 }

; 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: mustprogress uwtable
declare dso_local void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, ptr noundef) #1

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann19ClipPolygonByAABB3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef %4, ptr noundef %5) #1 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [2 x [64 x %"class.Maths::TVector3"]], align 16
  %14 = alloca [2 x i32], align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"class.Maths::TVector3", align 4
  %24 = alloca %"class.Maths::TVector3", align 4
  %25 = alloca %"class.Maths::TVector3", align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1536, ptr %13) #5
  %26 = getelementptr inbounds [2 x [64 x %"class.Maths::TVector3"]], ptr %13, i32 0, i32 0, i32 0
  %27 = getelementptr inbounds %"class.Maths::TVector3", ptr %26, i64 128
  br label %28

28:                                               ; preds = %28, %6
  %29 = phi ptr [ %26, %6 ], [ %30, %28 ]
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %29)
  %30 = getelementptr inbounds %"class.Maths::TVector3", ptr %29, i64 1
  %31 = icmp eq ptr %30, %27
  br i1 %31, label %32, label %28

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.memset.p0.i64(ptr align 4 %14, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %33, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %119, %32
  %35 = load i32, ptr %20, align 4, !tbaa !9
  %36 = icmp slt i32 %35, 3
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  store i32 2, ptr %21, align 4
  br label %122

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %113, %38
  %40 = load i32, ptr %22, align 4, !tbaa !9
  %41 = icmp slt i32 %40, 2
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  store i32 5, ptr %21, align 4
  br label %116

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #5
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %23)
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #5
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %24)
  %44 = load i32, ptr %22, align 4, !tbaa !9
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %55

46:                                               ; preds = %43
  %47 = load i32, ptr %20, align 4, !tbaa !9
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %24, i32 noundef %47)
  store float 1.000000e+00, ptr %48, align 4, !tbaa !11
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load i32, ptr %20, align 4, !tbaa !9
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %49, i32 noundef %50)
  %52 = load float, ptr %51, align 4, !tbaa !11
  %53 = load i32, ptr %20, align 4, !tbaa !9
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %23, i32 noundef %53)
  store float %52, ptr %54, align 4, !tbaa !11
  br label %64

55:                                               ; preds = %43
  %56 = load i32, ptr %20, align 4, !tbaa !9
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %24, i32 noundef %56)
  store float -1.000000e+00, ptr %57, align 4, !tbaa !11
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load i32, ptr %20, align 4, !tbaa !9
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %58, i32 noundef %59)
  %61 = load float, ptr %60, align 4, !tbaa !11
  %62 = load i32, ptr %20, align 4, !tbaa !9
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %23, i32 noundef %62)
  store float %61, ptr %63, align 4, !tbaa !11
  br label %64

64:                                               ; preds = %55, %46
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %69

67:                                               ; preds = %64
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %68, ptr %16, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  br label %79

69:                                               ; preds = %64
  %70 = load i32, ptr %15, align 4, !tbaa !9
  %71 = and i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [2 x [64 x %"class.Maths::TVector3"]], ptr %13, i64 0, i64 %72
  %74 = getelementptr inbounds [64 x %"class.Maths::TVector3"], ptr %73, i64 0, i64 0
  store ptr %74, ptr %16, align 8, !tbaa !5
  %75 = load i32, ptr %15, align 4, !tbaa !9
  %76 = and i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 %77
  store ptr %78, ptr %18, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %69, %67
  %80 = load i32, ptr %15, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %15, align 4, !tbaa !9
  %82 = load i32, ptr %15, align 4, !tbaa !9
  %83 = icmp eq i32 %82, 6
  br i1 %83, label %84, label %87

84:                                               ; preds = %79
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %85, ptr %17, align 8, !tbaa !5
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %86, ptr %19, align 8, !tbaa !5
  br label %97

87:                                               ; preds = %79
  %88 = load i32, ptr %15, align 4, !tbaa !9
  %89 = and i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [2 x [64 x %"class.Maths::TVector3"]], ptr %13, i64 0, i64 %90
  %92 = getelementptr inbounds [64 x %"class.Maths::TVector3"], ptr %91, i64 0, i64 0
  store ptr %92, ptr %17, align 8, !tbaa !5
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = and i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 %95
  store ptr %96, ptr %19, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %87, %84
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  %99 = load ptr, ptr %18, align 8, !tbaa !5
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = load ptr, ptr %17, align 8, !tbaa !5
  %102 = load ptr, ptr %19, align 8, !tbaa !5
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef %98, i32 noundef %100, ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef %101, ptr noundef %102)
  %103 = load ptr, ptr %19, align 8, !tbaa !5
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = icmp slt i32 %104, 3
  br i1 %105, label %106, label %108

106:                                              ; preds = %97
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %107, align 4, !tbaa !9
  store i32 1, ptr %21, align 4
  br label %110

108:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #5
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %25, ptr noundef nonnull align 4 dereferenceable(12) %24)
  %109 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef nonnull align 4 dereferenceable(12) %25)
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #5
  store i32 0, ptr %21, align 4
  br label %110

110:                                              ; preds = %108, %106
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #5
  %111 = load i32, ptr %21, align 4
  switch i32 %111, label %116 [
    i32 0, label %112
  ]

112:                                              ; preds = %110
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %22, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %22, align 4, !tbaa !9
  br label %39, !llvm.loop !13

116:                                              ; preds = %110, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  %117 = load i32, ptr %21, align 4
  switch i32 %117, label %122 [
    i32 5, label %118
  ]

118:                                              ; preds = %116
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %20, align 4, !tbaa !9
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %20, align 4, !tbaa !9
  br label %34, !llvm.loop !15

122:                                              ; preds = %116, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  %123 = load i32, ptr %21, align 4
  switch i32 %123, label %125 [
    i32 2, label %124
  ]

124:                                              ; preds = %122
  store i32 0, ptr %21, align 4
  br label %125

125:                                              ; preds = %124, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 1536, ptr %13) #5
  %126 = load i32, ptr %21, align 4
  switch i32 %126, label %128 [
    i32 0, label %127
    i32 1, label %127
  ]

127:                                              ; preds = %125, %125
  ret void

128:                                              ; preds = %125
  unreachable
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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 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: mustprogress uwtable
declare dso_local void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, ptr noundef) local_unnamed_addr #1

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann19ClipPolygonByAABB3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = alloca [2 x [64 x %"class.Maths::TVector3"]], align 16
  %8 = alloca [2 x i32], align 8
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca %"class.Maths::TVector3", align 4
  %11 = alloca %"class.Maths::TVector3", align 4
  call void @llvm.lifetime.start.p0(i64 1536, ptr nonnull %7) #4
  br label %12

12:                                               ; preds = %12, %6
  %.idx = phi i64 [ 0, %6 ], [ %.add, %12 ]
  %.ptr = getelementptr inbounds i8, ptr %7, i64 %.idx
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr)
  %.add = add nuw nsw i64 %.idx, 12
  %13 = icmp eq i64 %.add, 1536
  br i1 %13, label %.cont.peel, label %12

.cont.peel:                                       ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  store i64 0, ptr %8, align 8
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %10)
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %10, i32 noundef 0)
  store float 1.000000e+00, ptr %14, align 4, !tbaa !9
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %2, i32 noundef 0)
  %16 = load float, ptr %15, align 4, !tbaa !9
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %9, i32 noundef 0)
  store float %16, ptr %17, align 4, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %7, i64 768
  %19 = getelementptr inbounds i8, ptr %8, i64 4
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull %18, ptr noundef nonnull %19)
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 2
  br i1 %21, label %.cont.1.peel, label %.loopexit55

.cont.1.peel:                                     ; preds = %.cont.peel
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #4
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %22 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %10)
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %10, i32 noundef 0)
  store float -1.000000e+00, ptr %23, align 4, !tbaa !9
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 0)
  %25 = load float, ptr %24, align 4, !tbaa !9
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %9, i32 noundef 0)
  store float %25, ptr %26, align 4, !tbaa !9
  %.else.val.1.peel = load i32, ptr %19, align 4, !tbaa !5
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef nonnull %18, i32 noundef %.else.val.1.peel, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %27 = load i32, ptr %8, align 8, !tbaa !5
  %28 = icmp sgt i32 %27, 2
  br i1 %28, label %.preheader.peel.next, label %.loopexit55

.preheader.peel.next:                             ; preds = %.cont.1.peel
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #4
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %29 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %10)
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %10, i32 noundef 1)
  store float 1.000000e+00, ptr %30, align 4, !tbaa !9
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %2, i32 noundef 1)
  %32 = load float, ptr %31, align 4, !tbaa !9
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %9, i32 noundef 1)
  store float %32, ptr %33, align 4, !tbaa !9
  %.else.val = load i32, ptr %8, align 8, !tbaa !5
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef nonnull %7, i32 noundef %.else.val, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull %18, ptr noundef nonnull %19)
  %34 = load i32, ptr %19, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 2
  br i1 %35, label %.cont.1, label %.loopexit55

.cont.1:                                          ; preds = %.preheader.peel.next
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #4
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %10)
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %10, i32 noundef 1)
  store float -1.000000e+00, ptr %37, align 4, !tbaa !9
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 1)
  %39 = load float, ptr %38, align 4, !tbaa !9
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %9, i32 noundef 1)
  store float %39, ptr %40, align 4, !tbaa !9
  %.else.val.1 = load i32, ptr %19, align 4, !tbaa !5
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef nonnull %18, i32 noundef %.else.val.1, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %41 = load i32, ptr %8, align 8, !tbaa !5
  %42 = icmp sgt i32 %41, 2
  br i1 %42, label %.cont.157, label %.loopexit55

.cont.157:                                        ; preds = %.cont.1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #4
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %43 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %10)
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %10, i32 noundef 2)
  store float 1.000000e+00, ptr %44, align 4, !tbaa !9
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %2, i32 noundef 2)
  %46 = load float, ptr %45, align 4, !tbaa !9
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %9, i32 noundef 2)
  store float %46, ptr %47, align 4, !tbaa !9
  %.else.val.156 = load i32, ptr %8, align 8, !tbaa !5
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef nonnull %7, i32 noundef %.else.val.156, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull %18, ptr noundef nonnull %19)
  %48 = load i32, ptr %19, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 2
  br i1 %49, label %.cont.1.1, label %.loopexit55

.cont.1.1:                                        ; preds = %.cont.157
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #4
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %50 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %10)
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %10, i32 noundef 2)
  store float -1.000000e+00, ptr %51, align 4, !tbaa !9
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 2)
  %53 = load float, ptr %52, align 4, !tbaa !9
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Maths8TVector3IfEixEi(ptr noundef nonnull align 4 dereferenceable(12) %9, i32 noundef 2)
  store float %53, ptr %54, align 4, !tbaa !9
  %.else.val.1.1 = load i32, ptr %19, align 4, !tbaa !5
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef nonnull %18, i32 noundef %.else.val.1.1, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef %4, ptr noundef nonnull %5)
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, 2
  br i1 %56, label %.loopexit.loopexit, label %.loopexit55

.loopexit.loopexit:                               ; preds = %.cont.1.1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #4
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %57 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  br label %.loopexit

.loopexit55:                                      ; preds = %.cont.1, %.preheader.peel.next, %.cont.157, %.cont.1.1, %.cont.1.peel, %.cont.peel
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.loopexit55
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 1536, ptr nonnull %7) #4
  ret void
}

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass