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

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

@_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords = external hidden global [4 x %class.R2Point], align 16
@_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords = external hidden global i64, 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: inlinehint mustprogress uwtable
declare dso_local void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24)) #1

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3Rectangle4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(120) %0, i64 %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [4 x %class.R3Point], align 16
  %8 = alloca %class.R3Point, align 8
  %9 = alloca %class.R3Point, align 8
  %10 = alloca %class.R3Point, align 8
  %11 = alloca %class.R3Point, align 8
  %12 = alloca %class.RNFlags, align 8
  %13 = alloca %class.RNFlags, align 8
  %14 = alloca i32, align 4
  %15 = alloca %class.RNFlags, align 8
  %16 = alloca %class.RNFlags, align 8
  %17 = alloca i32, align 4
  %18 = getelementptr inbounds %class.RNFlags, ptr %3, i32 0, i32 0
  store i64 %1, ptr %18, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8
  %20 = call noundef i32 @_ZNK11R3Rectangle7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %19)
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %2
  br label %106

23:                                               ; preds = %2
  %24 = load atomic i8, ptr @_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords acquire, align 8
  %25 = icmp eq i8 %24, 0
  br i1 %25, label %26, label %34, !prof !9

26:                                               ; preds = %23
  %27 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords) #4
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %34

29:                                               ; preds = %26
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %30 unwind label %61

30:                                               ; preds = %29
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%class.R2Point, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 1), double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %31 unwind label %61

31:                                               ; preds = %30
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%class.R2Point, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 2), double noundef 1.000000e+00, double noundef 1.000000e+00)
          to label %32 unwind label %61

32:                                               ; preds = %31
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%class.R2Point, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 3), double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %33 unwind label %61

33:                                               ; preds = %32
  call void @__cxa_guard_release(ptr @_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords) #4
  br label %34

34:                                               ; preds = %33, %26, %23
  call void @llvm.lifetime.start.p0(i64 96, ptr %7) #4
  %35 = getelementptr inbounds [4 x %class.R3Point], ptr %7, i32 0, i32 0
  %36 = getelementptr inbounds %class.R3Point, ptr %35, i64 4
  br label %37

37:                                               ; preds = %37, %34
  %38 = phi ptr [ %35, %34 ], [ %39, %37 ]
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %38)
  %39 = getelementptr inbounds %class.R3Point, ptr %38, i64 1
  %40 = icmp eq ptr %39, %36
  br i1 %40, label %41, label %37

41:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  call void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(120) %19, i32 noundef 0)
  %42 = getelementptr inbounds [4 x %class.R3Point], ptr %7, i64 0, i64 0
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #4
  call void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(120) %19, i32 noundef 2)
  %44 = getelementptr inbounds [4 x %class.R3Point], ptr %7, i64 0, i64 1
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  call void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(120) %19, i32 noundef 3)
  %46 = getelementptr inbounds [4 x %class.R3Point], ptr %7, i64 0, i64 2
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  call void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(120) %19, i32 noundef 1)
  %48 = getelementptr inbounds [4 x %class.R3Point], ptr %7, i64 0, i64 3
  %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) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef 2)
  %50 = getelementptr inbounds %class.RNFlags, ptr %12, i32 0, i32 0
  %51 = load i64, ptr %50, align 8
  %52 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %51)
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %87

54:                                               ; preds = %41
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %13, i64 noundef 16)
  %55 = getelementptr inbounds %class.RNFlags, ptr %13, 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 %65

59:                                               ; preds = %54
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle6NormalEv(ptr noundef nonnull align 8 dereferenceable(120) %19)
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %60)
  br label %65

61:                                               ; preds = %32, %31, %30, %29
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %5, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %6, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords) #4
  br label %107

65:                                               ; preds = %59, %54
  call void @_Z14R3BeginPolygonv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !10
  br label %66

66:                                               ; preds = %83, %65
  %67 = load i32, ptr %14, align 4, !tbaa !10
  %68 = icmp slt i32 %67, 4
  br i1 %68, label %70, label %69

69:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %86

70:                                               ; preds = %66
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef 512)
  %71 = getelementptr inbounds %class.RNFlags, ptr %15, i32 0, i32 0
  %72 = load i64, ptr %71, align 8
  %73 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %72)
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %79

75:                                               ; preds = %70
  %76 = load i32, ptr %14, align 4, !tbaa !10
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [4 x %class.R2Point], ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 0, i64 %77
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) %78)
  br label %79

79:                                               ; preds = %75, %70
  %80 = load i32, ptr %14, align 4, !tbaa !10
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [4 x %class.R3Point], ptr %7, i64 0, i64 %81
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %82)
  br label %83

83:                                               ; preds = %79
  %84 = load i32, ptr %14, align 4, !tbaa !10
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %14, align 4, !tbaa !10
  br label %66, !llvm.loop !12

86:                                               ; preds = %69
  call void @_Z12R3EndPolygonv()
  br label %87

87:                                               ; preds = %86, %41
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef 1)
  %88 = getelementptr inbounds %class.RNFlags, ptr %16, i32 0, i32 0
  %89 = load i64, ptr %88, align 8
  %90 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %89)
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %105

92:                                               ; preds = %87
  call void @_Z11R3BeginLoopv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !10
  br label %93

93:                                               ; preds = %101, %92
  %94 = load i32, ptr %17, align 4, !tbaa !10
  %95 = icmp slt i32 %94, 4
  br i1 %95, label %97, label %96

96:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %104

97:                                               ; preds = %93
  %98 = load i32, ptr %17, align 4, !tbaa !10
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [4 x %class.R3Point], ptr %7, i64 0, i64 %99
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %100)
  br label %101

101:                                              ; preds = %97
  %102 = load i32, ptr %17, align 4, !tbaa !10
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %17, align 4, !tbaa !10
  br label %93, !llvm.loop !14

104:                                              ; preds = %96
  call void @_Z9R3EndLoopv()
  br label %105

105:                                              ; preds = %104, %87
  call void @llvm.lifetime.end.p0(i64 96, ptr %7) #4
  br label %106

106:                                              ; preds = %105, %22
  ret void

107:                                              ; preds = %61
  %108 = load ptr, ptr %5, align 8
  %109 = load i32, ptr %6, align 4
  %110 = insertvalue { ptr, i32 } poison, ptr %108, 0
  %111 = insertvalue { ptr, i32 } %110, i32 %109, 1
  resume { ptr, i32 } %111
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK11R3Rectangle7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(120)) #1 align 2

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #4

declare void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #4

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(120), i32 noundef) #1 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 }
attributes #5 = { "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" }

!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 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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

@_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords = external hidden global [4 x %class.R2Point], align 16
@_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords = external hidden global i64, 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: inlinehint mustprogress uwtable
declare dso_local void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3Rectangle4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(120) %0, i64 %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca [4 x %class.R3Point], align 16
  %5 = alloca %class.R3Point, align 8
  %6 = alloca %class.R3Point, align 8
  %7 = alloca %class.R3Point, align 8
  %8 = alloca %class.R3Point, align 8
  %9 = alloca %class.RNFlags, align 8
  %10 = alloca %class.RNFlags, align 8
  %11 = alloca %class.RNFlags, align 8
  %12 = alloca %class.RNFlags, align 8
  store i64 %1, ptr %3, align 8
  %13 = tail call noundef i32 @_ZNK11R3Rectangle7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %0)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %60

14:                                               ; preds = %2
  %15 = load atomic i8, ptr @_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords acquire, align 8
  %16 = icmp eq i8 %15, 0
  br i1 %16, label %17, label %24, !prof !5

17:                                               ; preds = %14
  %18 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords) #6
  %.not10 = icmp eq i32 %18, 0
  br i1 %.not10, label %24, label %19

19:                                               ; preds = %17
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %20 unwind label %36

20:                                               ; preds = %19
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 16), double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %21 unwind label %36

21:                                               ; preds = %20
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 32), double noundef 1.000000e+00, double noundef 1.000000e+00)
          to label %22 unwind label %36

22:                                               ; preds = %21
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 48), double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %23 unwind label %36

23:                                               ; preds = %22
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords) #6
  br label %24

24:                                               ; preds = %23, %17, %14
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %4) #6
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %.ptr.1 = getelementptr inbounds i8, ptr %4, i64 24
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %4, i64 48
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %4, i64 72
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef 0)
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef 2)
  %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) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %7, ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef 3)
  %27 = 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) %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(120) %0, i32 noundef 1)
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.3, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 2)
  %29 = load i64, ptr %9, align 8
  %30 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %29)
  %.not12 = icmp eq i32 %30, 0
  br i1 %.not12, label %55, label %31

31:                                               ; preds = %24
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 16)
  %32 = load i64, ptr %10, align 8
  %33 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %32)
  %.not13 = icmp eq i32 %33, 0
  br i1 %.not13, label %38, label %34

34:                                               ; preds = %31
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle6NormalEv(ptr noundef nonnull align 8 dereferenceable(120) %0)
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %35)
  br label %38

36:                                               ; preds = %22, %21, %20, %19
  %37 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZNK11R3Rectangle4DrawE7RNFlagsE9texcoords) #6
  resume { ptr, i32 } %37

38:                                               ; preds = %34, %31
  call void @_Z14R3BeginPolygonv()
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 512)
  %39 = load i64, ptr %11, align 8
  %40 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %39)
  %.not15 = icmp eq i32 %40, 0
  br i1 %.not15, label %42, label %41

41:                                               ; preds = %38
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords)
  br label %42

42:                                               ; preds = %41, %38
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 512)
  %43 = load i64, ptr %11, align 8
  %44 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %43)
  %.not15.1 = icmp eq i32 %44, 0
  br i1 %.not15.1, label %46, label %45

45:                                               ; preds = %42
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 16))
  br label %46

46:                                               ; preds = %45, %42
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 512)
  %47 = load i64, ptr %11, align 8
  %48 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %47)
  %.not15.2 = icmp eq i32 %48, 0
  br i1 %.not15.2, label %50, label %49

49:                                               ; preds = %46
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 32))
  br label %50

50:                                               ; preds = %49, %46
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 512)
  %51 = load i64, ptr %11, align 8
  %52 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %51)
  %.not15.3 = icmp eq i32 %52, 0
  br i1 %.not15.3, label %54, label %53

53:                                               ; preds = %50
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK11R3Rectangle4DrawE7RNFlagsE9texcoords, i64 48))
  br label %54

54:                                               ; preds = %53, %50
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.3)
  call void @_Z12R3EndPolygonv()
  br label %55

55:                                               ; preds = %54, %24
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef 1)
  %56 = load i64, ptr %12, align 8
  %57 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %56)
  %.not14 = icmp eq i32 %57, 0
  br i1 %.not14, label %59, label %58

58:                                               ; preds = %55
  call void @_Z11R3BeginLoopv()
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.3)
  call void @_Z9R3EndLoopv()
  br label %59

59:                                               ; preds = %58, %55
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #6
  br label %60

60:                                               ; preds = %2, %59
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK11R3Rectangle7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #1 align 2

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #4

declare void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK11R3Rectangle6CornerEi(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(120), i32 noundef) local_unnamed_addr #1 align 2

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 #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { nofree nounwind }
attributes #5 = { "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 #6 = { 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 = !{!"branch_weights", i32 1, i32 1048575}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass