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

; 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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Vector = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.R3Point = type { [3 x double] }
%class.RNFlags = type { i64 }
%class.R3Circle = type { %class.R3Surface, %class.R3Point, double, %class.R3Plane }
%class.R3Surface = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Plane = type { %class.R3Vector, double }

@R4identity_matrix = external global %class.R4Matrix, align 8
@R3posz_vector = external global %class.R3Vector, align 8
@R3circle_npoints = external constant i32, align 4
@R3circle_texcoords = external global [0 x %class.R2Point], align 8
@R3circle_points = external global [0 x %class.R3Point], align 8

; 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 @_ZNK8R4Matrix4PushEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8R4Matrix3PopEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z14R3BeginPolygonv() #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z12R3EndPolygonv() #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8), i64) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z11R3BeginLoopv() #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9R3EndLoopv() #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8R3Circle4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(72) %0, i64 %1) unnamed_addr #1 align 2 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.R4Matrix, align 8
  %6 = alloca %class.R3Vector, align 8
  %7 = alloca %class.RNFlags, align 8
  %8 = alloca %class.RNFlags, align 8
  %9 = alloca i32, align 4
  %10 = alloca %class.RNFlags, align 8
  %11 = alloca %class.R3Point, align 8
  %12 = alloca %class.RNFlags, align 8
  %13 = alloca i32, align 4
  %14 = alloca %class.R3Point, align 8
  %15 = getelementptr inbounds %class.RNFlags, ptr %3, i32 0, i32 0
  store i64 %1, ptr %15, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr %5) #5
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %5, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #5
  %17 = getelementptr inbounds %class.R3Circle, ptr %16, i32 0, i32 1
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %17)
  call void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128) %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72) %16)
  call void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128) %5, ptr noundef nonnull align 8 dereferenceable(24) @R3posz_vector, ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @_ZNK8R4Matrix4PushEv(ptr noundef nonnull align 8 dereferenceable(128) %5)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef 2)
  %19 = getelementptr inbounds %class.RNFlags, ptr %7, i32 0, i32 0
  %20 = load i64, ptr %19, align 8
  %21 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %20)
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %54

23:                                               ; preds = %2
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 16)
  %24 = getelementptr inbounds %class.RNFlags, ptr %8, i32 0, i32 0
  %25 = load i64, ptr %24, align 8
  %26 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %25)
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) @R3posz_vector)
  br label %29

29:                                               ; preds = %28, %23
  call void @_Z14R3BeginPolygonv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %50, %29
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr @R3circle_npoints, align 4, !tbaa !9
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %53

35:                                               ; preds = %30
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 512)
  %36 = getelementptr inbounds %class.RNFlags, ptr %10, i32 0, i32 0
  %37 = load i64, ptr %36, align 8
  %38 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %37)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %44

40:                                               ; preds = %35
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [0 x %class.R2Point], ptr @R3circle_texcoords, i64 0, i64 %42
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) %43)
  br label %44

44:                                               ; preds = %40, %35
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [0 x %class.R3Point], ptr @R3circle_points, i64 0, i64 %46
  %48 = getelementptr inbounds %class.R3Circle, ptr %16, i32 0, i32 2
  %49 = load double, ptr %48, align 8, !tbaa !11
  call void @_ZmlRK7R3Pointd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(24) %47, double noundef %49)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  br label %50

50:                                               ; preds = %44
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %9, align 4, !tbaa !9
  br label %30, !llvm.loop !19

53:                                               ; preds = %34
  call void @_Z12R3EndPolygonv()
  br label %54

54:                                               ; preds = %53, %2
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef 1)
  %55 = getelementptr inbounds %class.RNFlags, ptr %12, i32 0, i32 0
  %56 = load i64, ptr %55, align 8
  %57 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %56)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %75

59:                                               ; preds = %54
  call void @_Z11R3BeginLoopv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %71, %59
  %61 = load i32, ptr %13, align 4, !tbaa !9
  %62 = load i32, ptr @R3circle_npoints, align 4, !tbaa !9
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %74

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [0 x %class.R3Point], ptr @R3circle_points, i64 0, i64 %67
  %69 = getelementptr inbounds %class.R3Circle, ptr %16, i32 0, i32 2
  %70 = load double, ptr %69, align 8, !tbaa !11
  call void @_ZmlRK7R3Pointd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %68, double noundef %70)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %71

71:                                               ; preds = %65
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %13, align 4, !tbaa !9
  br label %60, !llvm.loop !21

74:                                               ; preds = %64
  call void @_Z9R3EndLoopv()
  br label %75

75:                                               ; preds = %74, %54
  call void @_ZNK8R4Matrix3PopEv(ptr noundef nonnull align 8 dereferenceable(128) %5)
  call void @llvm.lifetime.end.p0(i64 128, ptr %5) #5
  ret void
}

declare void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #4

declare void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

declare void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72)) #3 align 2

declare void @_ZmlRK7R3Pointd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), double noundef) #4

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 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 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 #4 = { "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, !16, i64 32}
!12 = !{!"_ZTS8R3Circle", !13, i64 0, !15, i64 8, !16, i64 32, !17, i64 40}
!13 = !{!"_ZTS9R3Surface", !14, i64 0}
!14 = !{!"_ZTS7R3Shape"}
!15 = !{!"_ZTS7R3Point", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTS7R3Plane", !18, i64 0, !16, i64 24}
!18 = !{!"_ZTS8R3Vector", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


; 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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Vector = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.R3Point = type { [3 x double] }
%class.RNFlags = type { i64 }

@R4identity_matrix = external global %class.R4Matrix, align 8
@R3posz_vector = external global %class.R3Vector, align 8
@R3circle_npoints = external local_unnamed_addr constant i32, align 4
@R3circle_texcoords = external global [0 x %class.R2Point], align 8
@R3circle_points = external global [0 x %class.R3Point], align 8

; 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 @_ZNK8R4Matrix4PushEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8R4Matrix3PopEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z14R3BeginPolygonv() local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z12R3EndPolygonv() local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8), i64) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z11R3BeginLoopv() local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9R3EndLoopv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8R3Circle4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(72) %0, i64 %1) unnamed_addr #1 align 2 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca %class.R4Matrix, align 8
  %5 = alloca %class.R3Vector, align 8
  %6 = alloca %class.RNFlags, align 8
  %7 = alloca %class.RNFlags, align 8
  %8 = alloca %class.RNFlags, align 8
  %9 = alloca %class.R3Point, align 8
  %10 = alloca %class.RNFlags, align 8
  %11 = alloca %class.R3Point, align 8
  store i64 %1, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #5
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %4, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  call void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128) %4, ptr noundef nonnull align 8 dereferenceable(24) @R3posz_vector, ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @_ZNK8R4Matrix4PushEv(ptr noundef nonnull align 8 dereferenceable(128) %4)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 2)
  %14 = load i64, ptr %6, align 8
  %15 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %14)
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %32, label %16

16:                                               ; preds = %2
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef 16)
  %17 = load i64, ptr %7, align 8
  %18 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %17)
  %.not8 = icmp eq i32 %18, 0
  br i1 %.not8, label %20, label %19

19:                                               ; preds = %16
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) @R3posz_vector)
  br label %20

20:                                               ; preds = %19, %16
  call void @_Z14R3BeginPolygonv()
  %21 = load i32, ptr @R3circle_npoints, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %20
  %23 = getelementptr inbounds i8, ptr %0, i64 32
  %wide.trip.count = zext nneg i32 %21 to i64
  br label %24

._crit_edge:                                      ; preds = %29, %20
  call void @_Z12R3EndPolygonv()
  br label %32

24:                                               ; preds = %.lr.ph, %29
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %29 ]
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 512)
  %25 = load i64, ptr %8, align 8
  %26 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %25)
  %.not10 = icmp eq i32 %26, 0
  br i1 %.not10, label %29, label %27

27:                                               ; preds = %24
  %28 = getelementptr inbounds [0 x %class.R2Point], ptr @R3circle_texcoords, i64 0, i64 %indvars.iv
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) %28)
  br label %29

29:                                               ; preds = %27, %24
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %30 = getelementptr inbounds [0 x %class.R3Point], ptr @R3circle_points, i64 0, i64 %indvars.iv
  %31 = load double, ptr %23, align 8, !tbaa !9
  call void @_ZmlRK7R3Pointd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %30, double noundef %31)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %24, !llvm.loop !17

32:                                               ; preds = %._crit_edge, %2
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 1)
  %33 = load i64, ptr %10, align 8
  %34 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %33)
  %.not9 = icmp eq i32 %34, 0
  br i1 %.not9, label %42, label %35

35:                                               ; preds = %32
  call void @_Z11R3BeginLoopv()
  %36 = load i32, ptr @R3circle_npoints, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph14, label %._crit_edge15

.lr.ph14:                                         ; preds = %35
  %38 = getelementptr inbounds i8, ptr %0, i64 32
  %wide.trip.count20 = zext nneg i32 %36 to i64
  br label %39

._crit_edge15:                                    ; preds = %39, %35
  call void @_Z9R3EndLoopv()
  br label %42

39:                                               ; preds = %.lr.ph14, %39
  %indvars.iv17 = phi i64 [ 0, %.lr.ph14 ], [ %indvars.iv.next18, %39 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  %40 = getelementptr inbounds [0 x %class.R3Point], ptr @R3circle_points, i64 0, i64 %indvars.iv17
  %41 = load double, ptr %38, align 8, !tbaa !9
  call void @_ZmlRK7R3Pointd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(24) %40, double noundef %41)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  %indvars.iv.next18 = add nuw nsw i64 %indvars.iv17, 1
  %exitcond21.not = icmp eq i64 %indvars.iv.next18, %wide.trip.count20
  br i1 %exitcond21.not, label %._crit_edge15, label %39, !llvm.loop !19

42:                                               ; preds = %._crit_edge15, %32
  call void @_ZNK8R4Matrix3PopEv(ptr noundef nonnull align 8 dereferenceable(128) %4)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #5
  ret void
}

declare void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #4

declare void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

declare void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #3 align 2

declare void @_ZmlRK7R3Pointd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), double noundef) local_unnamed_addr #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 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 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 #4 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !14, i64 32}
!10 = !{!"_ZTS8R3Circle", !11, i64 0, !13, i64 8, !14, i64 32, !15, i64 40}
!11 = !{!"_ZTS9R3Surface", !12, i64 0}
!12 = !{!"_ZTS7R3Shape"}
!13 = !{!"_ZTS7R3Point", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTS7R3Plane", !16, i64 0, !14, i64 24}
!16 = !{!"_ZTS8R3Vector", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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