; 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 void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) 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)) #3 align 2

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

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

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.memset.p0.i64(ptr align 4 %16, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %35, align 4, !tbaa !9
  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 8, ptr %20) #5
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  store ptr null, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %98, %34
  %37 = load i32, ptr %22, align 4, !tbaa !9
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 2, ptr %23, align 4
  br label %101

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #5
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load i32, ptr %22, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %"class.Maths::TVector3", ptr %42, i64 %44
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef nonnull align 4 dereferenceable(12) %45)
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = load i32, ptr %22, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = srem i32 %48, %49
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds %"class.Maths::TVector3", ptr %46, i64 %51
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %25, ptr noundef nonnull align 4 dereferenceable(12) %52)
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #5
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %27, ptr noundef nonnull align 4 dereferenceable(12) %25, ptr noundef nonnull align 4 dereferenceable(12) %24)
  call void @_ZNK5Maths8TVector3IfE5CrossERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %26, ptr noundef nonnull align 4 dereferenceable(12) %53, ptr noundef nonnull align 4 dereferenceable(12) %27)
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #5
  %54 = load i32, ptr %22, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %58

56:                                               ; preds = %41
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %57, ptr %18, align 8, !tbaa !5
  store ptr %9, ptr %20, align 8, !tbaa !5
  br label %66

58:                                               ; preds = %41
  %59 = load i32, ptr %17, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [2 x [64 x %"class.Maths::TVector3"]], ptr %15, i64 0, i64 %60
  %62 = getelementptr inbounds [64 x %"class.Maths::TVector3"], ptr %61, i64 0, i64 0
  store ptr %62, ptr %18, align 8, !tbaa !5
  %63 = load i32, ptr %17, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [2 x i32], ptr %16, i64 0, i64 %64
  store ptr %65, ptr %20, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %58, %56
  %67 = load i32, ptr %17, align 4, !tbaa !9
  %68 = sub nsw i32 1, %67
  store i32 %68, ptr %17, align 4, !tbaa !9
  %69 = load i32, ptr %22, align 4, !tbaa !9
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = sub nsw i32 %70, 1
  %72 = icmp eq i32 %69, %71
  br i1 %72, label %73, label %76

73:                                               ; preds = %66
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %74, ptr %19, align 8, !tbaa !5
  %75 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %75, ptr %21, align 8, !tbaa !5
  br label %84

76:                                               ; preds = %66
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [2 x [64 x %"class.Maths::TVector3"]], ptr %15, i64 0, i64 %78
  %80 = getelementptr inbounds [64 x %"class.Maths::TVector3"], ptr %79, i64 0, i64 0
  store ptr %80, ptr %19, align 8, !tbaa !5
  %81 = load i32, ptr %17, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [2 x i32], ptr %16, i64 0, i64 %82
  store ptr %83, ptr %21, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %76, %73
  %85 = load ptr, ptr %18, align 8, !tbaa !5
  %86 = load ptr, ptr %20, align 8, !tbaa !5
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = load ptr, ptr %19, align 8, !tbaa !5
  %89 = load ptr, ptr %21, align 8, !tbaa !5
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef %85, i32 noundef %87, ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef nonnull align 4 dereferenceable(12) %26, ptr noundef %88, ptr noundef %89)
  %90 = load ptr, ptr %21, align 8, !tbaa !5
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = icmp slt i32 %91, 3
  br i1 %92, label %93, label %94

93:                                               ; preds = %84
  store ptr null, ptr %14, align 8, !tbaa !5
  store i32 2, ptr %23, align 4
  br label %95

94:                                               ; preds = %84
  store i32 0, ptr %23, align 4
  br label %95

95:                                               ; preds = %94, %93
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #5
  %96 = load i32, ptr %23, align 4
  switch i32 %96, label %101 [
    i32 0, label %97
  ]

97:                                               ; preds = %95
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %22, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %22, align 4, !tbaa !9
  br label %36, !llvm.loop !11

101:                                              ; preds = %95, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %102

102:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  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 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 1536, ptr %15) #5
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfE5CrossERKS1_(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

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!11, !12}
!12 = !{!"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 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 void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) 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
define dso_local void @_ZN7Riemann29ClipPolygonByProjectPolygon3DEPKN5Maths8TVector3IfEEiS4_iRS3_PS2_Pi(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #1 {
  %8 = alloca [2 x [64 x %"class.Maths::TVector3"]], align 16
  %9 = alloca [2 x i32], align 8
  %10 = alloca %"class.Maths::TVector3", align 4
  %11 = alloca %"class.Maths::TVector3", align 4
  %12 = alloca %"class.Maths::TVector3", align 4
  %13 = alloca %"class.Maths::TVector3", align 4
  call void @llvm.lifetime.start.p0(i64 1536, ptr nonnull %8) #5
  br label %14

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

.peel.begin:                                      ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store i64 0, ptr %9, align 8
  store i32 0, ptr %6, align 4, !tbaa !5
  %16 = add nsw i32 %3, -1
  %17 = zext i32 %16 to i64
  %smax = call i32 @llvm.smax.i32(i32 %3, i32 0)
  %wide.trip.count = zext nneg i32 %smax to i64
  %exitcond.peel.not = icmp slt i32 %3, 1
  br i1 %exitcond.peel.not, label %.loopexit, label %.cont.peel

.cont.peel:                                       ; preds = %.peel.begin
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #5
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #5
  %18 = icmp ne i32 %3, 1
  %19 = zext i1 %18 to i64
  %20 = getelementptr inbounds %"class.Maths::TVector3", ptr %2, i64 %19
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #5
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @_ZNK5Maths8TVector3IfE5CrossERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  %21 = icmp eq i32 %16, 0
  %22 = getelementptr inbounds i8, ptr %9, i64 4
  %.027.peel = select i1 %21, ptr %6, ptr %22
  %23 = getelementptr inbounds i8, ptr %8, i64 768
  %.029.peel = select i1 %21, ptr %5, ptr %23
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef %.029.peel, ptr noundef nonnull %.027.peel)
  %24 = load i32, ptr %.027.peel, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 2
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #5
  br i1 %25, label %.peel.next, label %.loopexit

.peel.next:                                       ; preds = %.cont.peel, %.cont
  %indvars.iv = phi i64 [ %indvars.iv.next, %.cont ], [ 1, %.cont.peel ]
  %.031 = phi i32 [ %33, %.cont ], [ 1, %.cont.peel ]
  %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.cont

.cont:                                            ; preds = %.peel.next
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #5
  %26 = getelementptr inbounds %"class.Maths::TVector3", ptr %2, i64 %indvars.iv
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %26)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = trunc nuw i64 %indvars.iv.next to i32
  %28 = srem i32 %27, %3
  %29 = zext nneg i32 %28 to i64
  %30 = getelementptr inbounds %"class.Maths::TVector3", ptr %2, i64 %29
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %30)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #5
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @_ZNK5Maths8TVector3IfE5CrossERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  %31 = zext nneg i32 %.031 to i64
  %32 = getelementptr inbounds [2 x [64 x %"class.Maths::TVector3"]], ptr %8, i64 0, i64 %31
  %33 = sub nuw nsw i32 1, %.031
  %34 = icmp eq i64 %indvars.iv, %17
  %35 = zext nneg i32 %33 to i64
  %36 = getelementptr inbounds [2 x [64 x %"class.Maths::TVector3"]], ptr %8, i64 0, i64 %35
  %37 = getelementptr inbounds [2 x i32], ptr %9, i64 0, i64 %35
  %.029 = select i1 %34, ptr %5, ptr %36
  %.027 = select i1 %34, ptr %6, ptr %37
  %38 = getelementptr inbounds [2 x i32], ptr %9, i64 0, i64 %31
  %.else.val = load i32, ptr %38, align 4, !tbaa !5
  call void @_ZN7Riemann20ClipPolygonByPlane3DEPKN5Maths8TVector3IfEEiRS3_S5_PS2_Pi(ptr noundef nonnull %32, i32 noundef %.else.val, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef %.029, ptr noundef nonnull %.027)
  %39 = load i32, ptr %.027, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 2
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #5
  br i1 %40, label %.peel.next, label %.loopexit, !llvm.loop !9

.loopexit:                                        ; preds = %.peel.next, %.cont, %.cont.peel, %.peel.begin
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 1536, ptr nonnull %8) #5
  ret void
}

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfE5CrossERKS1_(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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}


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