; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Polyline.ll (ZNK10R3Polyline8IsPlanarEv)

; 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.R3Vector = type { [3 x double] }
%class.R3Plane = type { %class.R3Vector, double }
%class.R3Point = type { [3 x double] }
%class.R3Polyline = type { %class.R3Curve, ptr, ptr, ptr, i32, %class.R3Box }
%class.R3Curve = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

declare void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0

declare noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK10R3Polyline8IsPlanarEv(ptr noundef nonnull align 8 dereferenceable(96) %0) unnamed_addr #2 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %class.R3Plane, align 8
  %5 = alloca i32, align 4
  %6 = alloca [3 x %class.R3Point], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %class.R3Vector, align 8
  %10 = alloca %class.R3Vector, align 8
  %11 = alloca %class.R3Vector, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  %13 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 4
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %1
  store i32 0, ptr %2, align 4
  br label %130

17:                                               ; preds = %1
  %18 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 4
  %19 = load i32, ptr %18, align 8, !tbaa !9
  %20 = icmp sle i32 %19, 3
  br i1 %20, label %21, label %22

21:                                               ; preds = %17
  store i32 1, ptr %2, align 4
  br label %130

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #3
  call void @_ZN7R3PlaneC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 72, ptr %6) #3
  %23 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i32 0, i32 0
  %24 = getelementptr inbounds %class.R3Point, ptr %23, i64 3
  br label %25

25:                                               ; preds = %25, %22
  %26 = phi ptr [ %23, %22 ], [ %27, %25 ]
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %26)
  %27 = getelementptr inbounds %class.R3Point, ptr %26, i64 1
  %28 = icmp eq ptr %27, %24
  br i1 %28, label %29, label %25

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !17
  br label %30

30:                                               ; preds = %123, %29
  %31 = load i32, ptr %7, align 4, !tbaa !17
  %32 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 4
  %33 = load i32, ptr %32, align 8, !tbaa !9
  %34 = icmp slt i32 %31, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %30
  store i32 2, ptr %8, align 4
  br label %126

36:                                               ; preds = %30
  %37 = load i32, ptr %5, align 4, !tbaa !17
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %50

39:                                               ; preds = %36
  %40 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = load i32, ptr %7, align 4, !tbaa !17
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %class.R3Point, ptr %41, i64 %43
  %45 = load i32, ptr %5, align 4, !tbaa !17
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %5, align 4, !tbaa !17
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 %47
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(24) %44)
  br label %122

50:                                               ; preds = %36
  %51 = load i32, ptr %5, align 4, !tbaa !17
  %52 = icmp eq i32 %51, 1
  br i1 %52, label %53, label %73

53:                                               ; preds = %50
  %54 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 0
  %55 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !18
  %57 = load i32, ptr %7, align 4, !tbaa !17
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %class.R3Point, ptr %56, i64 %58
  %60 = call noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 8 dereferenceable(24) %59)
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %73, label %62

62:                                               ; preds = %53
  %63 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !18
  %65 = load i32, ptr %7, align 4, !tbaa !17
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %class.R3Point, ptr %64, i64 %66
  %68 = load i32, ptr %5, align 4, !tbaa !17
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %5, align 4, !tbaa !17
  %70 = sext i32 %68 to i64
  %71 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 %70
  %72 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef nonnull align 8 dereferenceable(24) %67)
  br label %121

73:                                               ; preds = %53, %50
  %74 = load i32, ptr %5, align 4, !tbaa !17
  %75 = icmp eq i32 %74, 2
  br i1 %75, label %76, label %110

76:                                               ; preds = %73
  %77 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 0
  %78 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !18
  %80 = load i32, ptr %7, align 4, !tbaa !17
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds %class.R3Point, ptr %79, i64 %81
  %83 = call noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %77, ptr noundef nonnull align 8 dereferenceable(24) %82)
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %110, label %85

85:                                               ; preds = %76
  %86 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 1
  %87 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !18
  %89 = load i32, ptr %7, align 4, !tbaa !17
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds %class.R3Point, ptr %88, i64 %90
  %92 = call noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 8 dereferenceable(24) %91)
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %110, label %94

94:                                               ; preds = %85
  %95 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8, !tbaa !18
  %97 = load i32, ptr %7, align 4, !tbaa !17
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds %class.R3Point, ptr %96, i64 %98
  %100 = load i32, ptr %5, align 4, !tbaa !17
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %5, align 4, !tbaa !17
  %102 = sext i32 %100 to i64
  %103 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 %102
  %104 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %103, ptr noundef nonnull align 8 dereferenceable(24) %99)
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #3
  %105 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 1
  %106 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 0
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 8 dereferenceable(24) %106)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #3
  %107 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 2
  %108 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 0
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %107, ptr noundef nonnull align 8 dereferenceable(24) %108)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #3
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %11, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %109 = getelementptr inbounds [3 x %class.R3Point], ptr %6, i64 0, i64 0
  call void @_ZN7R3Plane5ResetERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(24) %109, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #3
  br label %120

110:                                              ; preds = %85, %76, %73
  %111 = getelementptr inbounds %class.R3Polyline, ptr %12, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !18
  %113 = load i32, ptr %7, align 4, !tbaa !17
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %class.R3Point, ptr %112, i64 %114
  %116 = call noundef i32 @_Z10R3ContainsRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(24) %115)
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %110
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %126

119:                                              ; preds = %110
  br label %120

120:                                              ; preds = %119, %94
  br label %121

121:                                              ; preds = %120, %62
  br label %122

122:                                              ; preds = %121, %39
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %7, align 4, !tbaa !17
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %7, align 4, !tbaa !17
  br label %30, !llvm.loop !19

126:                                              ; preds = %118, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %127 = load i32, ptr %8, align 4
  switch i32 %127, label %129 [
    i32 2, label %128
  ]

128:                                              ; preds = %126
  store i32 1, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %129

129:                                              ; preds = %128, %126
  call void @llvm.lifetime.end.p0(i64 72, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #3
  br label %130

130:                                              ; preds = %129, %21, %16
  %131 = load i32, ptr %2, align 4
  ret i32 %131
}

declare void @_ZN7R3PlaneC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

declare void @_ZN7R3Plane5ResetERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

declare noundef i32 @_Z10R3ContainsRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) #0

attributes #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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !13, i64 32}
!10 = !{!"_ZTS10R3Polyline", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !14, i64 40}
!11 = !{!"_ZTS7R3Curve", !12, i64 0}
!12 = !{!"_ZTS7R3Shape"}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS5R3Box", !15, i64 0, !16, i64 8, !16, i64 32}
!15 = !{!"_ZTS7R3Solid", !12, i64 0}
!16 = !{!"_ZTS7R3Point", !7, i64 0}
!17 = !{!13, !13, i64 0}
!18 = !{!10, !6, i64 8}
!19 = distinct !{!19, !20}
!20 = !{!"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.R3Vector = type { [3 x double] }
%class.R3Plane = type { %class.R3Vector, double }
%class.R3Point = type { [3 x double] }

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

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

declare void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZNK10R3Polyline8IsPlanarEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(96) %0) unnamed_addr #2 align 2 {
  %2 = alloca %class.R3Plane, align 8
  %3 = alloca [3 x %class.R3Point], align 16
  %4 = alloca %class.R3Vector, align 8
  %5 = alloca %class.R3Vector, align 8
  %6 = alloca %class.R3Vector, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %46, label %10

10:                                               ; preds = %1
  %11 = icmp slt i32 %8, 4
  br i1 %11, label %46, label %.preheader

.preheader:                                       ; preds = %10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #3
  call void @_ZN7R3PlaneC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %2)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #3
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %.ptr.1 = getelementptr inbounds i8, ptr %3, i64 24
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %3, i64 48
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %12 = load i32, ptr %7, align 8, !tbaa !5
  %.not2627 = icmp slt i32 %12, 1
  br i1 %.not2627, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  br label %14

14:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %.01828 = phi i32 [ 0, %.lr.ph ], [ %.1, %43 ]
  switch i32 %.01828, label %39 [
    i32 0, label %15
    i32 1, label %19
    i32 2, label %27
  ]

15:                                               ; preds = %14
  %16 = load ptr, ptr %13, align 8, !tbaa !16
  %17 = getelementptr inbounds %class.R3Point, ptr %16, i64 %indvars.iv
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %17)
  br label %43

19:                                               ; preds = %14
  %20 = load ptr, ptr %13, align 8, !tbaa !16
  %21 = getelementptr inbounds %class.R3Point, ptr %20, i64 %indvars.iv
  %22 = call noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %21)
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %23, label %39

23:                                               ; preds = %19
  %24 = load ptr, ptr %13, align 8, !tbaa !16
  %25 = getelementptr inbounds %class.R3Point, ptr %24, i64 %indvars.iv
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %25)
  br label %43

27:                                               ; preds = %14
  %28 = load ptr, ptr %13, align 8, !tbaa !16
  %29 = getelementptr inbounds %class.R3Point, ptr %28, i64 %indvars.iv
  %30 = call noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %29)
  %.not23 = icmp eq i32 %30, 0
  br i1 %.not23, label %31, label %39

31:                                               ; preds = %27
  %32 = load ptr, ptr %13, align 8, !tbaa !16
  %33 = getelementptr inbounds %class.R3Point, ptr %32, i64 %indvars.iv
  %34 = call noundef i32 @_Z10R3ContainsRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %33)
  %.not24 = icmp eq i32 %34, 0
  br i1 %.not24, label %35, label %39

35:                                               ; preds = %31
  %36 = load ptr, ptr %13, align 8, !tbaa !16
  %37 = getelementptr inbounds %class.R3Point, ptr %36, i64 %indvars.iv
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, ptr noundef nonnull align 8 dereferenceable(24) %37)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @_ZN7R3Plane5ResetERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  br label %43

39:                                               ; preds = %19, %14, %31, %27
  %40 = load ptr, ptr %13, align 8, !tbaa !16
  %41 = getelementptr inbounds %class.R3Point, ptr %40, i64 %indvars.iv
  %42 = call noundef i32 @_Z10R3ContainsRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(24) %41)
  %.not25 = icmp eq i32 %42, 0
  br i1 %.not25, label %._crit_edge, label %43

43:                                               ; preds = %15, %35, %39, %23
  %.1 = phi i32 [ 1, %15 ], [ %.01828, %39 ], [ 3, %35 ], [ 2, %23 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = load i32, ptr %7, align 8, !tbaa !5
  %45 = sext i32 %44 to i64
  %.not26.not = icmp slt i64 %indvars.iv.next, %45
  br i1 %.not26.not, label %14, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %43, %39, %.preheader
  %.not26.lcssa = phi i32 [ 1, %.preheader ], [ 0, %39 ], [ 1, %43 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #3
  br label %46

46:                                               ; preds = %10, %1, %._crit_edge
  %.2 = phi i32 [ %.not26.lcssa, %._crit_edge ], [ 0, %1 ], [ 1, %10 ]
  ret i32 %.2
}

declare void @_ZN7R3PlaneC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare void @_ZN7R3Plane5ResetERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare noundef i32 @_Z10R3ContainsRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

attributes #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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !12, i64 32}
!6 = !{!"_ZTS10R3Polyline", !7, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !12, i64 32, !13, i64 40}
!7 = !{!"_ZTS7R3Curve", !8, i64 0}
!8 = !{!"_ZTS7R3Shape"}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!"_ZTS5R3Box", !14, i64 0, !15, i64 8, !15, i64 32}
!14 = !{!"_ZTS7R3Solid", !8, i64 0}
!15 = !{!"_ZTS7R3Point", !10, i64 0}
!16 = !{!6, !9, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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