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

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

@_ZZNK5R3Box4DrawE7RNFlagsE7normals = external hidden global [6 x %class.R3Vector], align 16
@_ZGVZNK5R3Box4DrawE7RNFlagsE7normals = external hidden global i64, align 8
@_ZZNK5R3Box4DrawE7RNFlagsE9texcoords = external hidden global [4 x %class.R2Point], align 16
@_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords = external hidden global i64, align 8
@_ZZNK5R3Box4DrawE7RNFlagsE13surface_paths = external hidden global [6 x [4 x i32]], align 16
@_ZZNK5R3Box4DrawE7RNFlagsE12outline_path = external hidden global [16 x i32], align 16

; 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 @_Z11R3BeginLinev() #1

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

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

declare void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #3

; 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 #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK5R3Box4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 %1) unnamed_addr #5 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 [8 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.R3Point, align 8
  %13 = alloca %class.R3Point, align 8
  %14 = alloca %class.R3Point, align 8
  %15 = alloca %class.R3Point, align 8
  %16 = alloca %class.RNFlags, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %class.RNFlags, align 8
  %20 = alloca i32, align 4
  %21 = alloca %class.RNFlags, align 8
  %22 = alloca %class.RNFlags, align 8
  %23 = alloca i32, align 4
  %24 = getelementptr inbounds %class.RNFlags, ptr %3, i32 0, i32 0
  store i64 %1, ptr %24, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8
  %26 = load atomic i8, ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE7normals acquire, align 8
  %27 = icmp eq i8 %26, 0
  br i1 %27, label %28, label %38, !prof !9

28:                                               ; preds = %2
  %29 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE7normals) #4
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %38

31:                                               ; preds = %28
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) @_ZZNK5R3Box4DrawE7RNFlagsE7normals, double noundef -1.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %32 unwind label %82

32:                                               ; preds = %31
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%class.R3Vector, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 1), double noundef 1.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %33 unwind label %82

33:                                               ; preds = %32
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%class.R3Vector, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 2), double noundef 0.000000e+00, double noundef -1.000000e+00, double noundef 0.000000e+00)
          to label %34 unwind label %82

34:                                               ; preds = %33
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%class.R3Vector, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 3), double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %35 unwind label %82

35:                                               ; preds = %34
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%class.R3Vector, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 4), double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef -1.000000e+00)
          to label %36 unwind label %82

36:                                               ; preds = %35
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (%class.R3Vector, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 5), double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %37 unwind label %82

37:                                               ; preds = %36
  call void @__cxa_guard_release(ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE7normals) #4
  br label %38

38:                                               ; preds = %37, %28, %2
  %39 = load atomic i8, ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords acquire, align 8
  %40 = icmp eq i8 %39, 0
  br i1 %40, label %41, label %49, !prof !9

41:                                               ; preds = %38
  %42 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords) #4
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %49

44:                                               ; preds = %41
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %45 unwind label %86

45:                                               ; preds = %44
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%class.R2Point, ptr @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, i64 1), double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %46 unwind label %86

46:                                               ; preds = %45
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%class.R2Point, ptr @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, i64 2), double noundef 1.000000e+00, double noundef 1.000000e+00)
          to label %47 unwind label %86

47:                                               ; preds = %46
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%class.R2Point, ptr @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, i64 3), double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %48 unwind label %86

48:                                               ; preds = %47
  call void @__cxa_guard_release(ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords) #4
  br label %49

49:                                               ; preds = %48, %41, %38
  call void @llvm.lifetime.start.p0(i64 192, ptr %7) #4
  %50 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i32 0, i32 0
  %51 = getelementptr inbounds %class.R3Point, ptr %50, i64 8
  br label %52

52:                                               ; preds = %52, %49
  %53 = phi ptr [ %50, %49 ], [ %54, %52 ]
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %53)
  %54 = getelementptr inbounds %class.R3Point, ptr %53, i64 1
  %55 = icmp eq ptr %54, %51
  br i1 %55, label %56, label %52

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 0)
  %57 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 0
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %57, 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 @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 1)
  %59 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 1
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %59, 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 @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 3)
  %61 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 2
  %62 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %61, 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 @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 2)
  %63 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 3
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #4
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %12, ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 4)
  %65 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 4
  %66 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %65, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 5)
  %67 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 5
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #4
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %14, ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 7)
  %69 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 6
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #4
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %15, ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 6)
  %71 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 7
  %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) %15)
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #4
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef 2)
  %73 = getelementptr inbounds %class.RNFlags, ptr %16, i32 0, i32 0
  %74 = load i64, ptr %73, align 8
  %75 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %74)
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %131

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

78:                                               ; preds = %127, %77
  %79 = load i32, ptr %17, align 4, !tbaa !10
  %80 = icmp slt i32 %79, 6
  br i1 %80, label %90, label %81

81:                                               ; preds = %78
  store i32 2, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %130

82:                                               ; preds = %36, %35, %34, %33, %32, %31
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %5, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %6, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE7normals) #4
  br label %153

86:                                               ; preds = %47, %46, %45, %44
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %5, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %6, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords) #4
  br label %153

90:                                               ; preds = %78
  call void @_Z14R3BeginPolygonv()
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %19, i64 noundef 16)
  %91 = getelementptr inbounds %class.RNFlags, ptr %19, i32 0, i32 0
  %92 = load i64, ptr %91, align 8
  %93 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %99

95:                                               ; preds = %90
  %96 = load i32, ptr %17, align 4, !tbaa !10
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [6 x %class.R3Vector], ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 0, i64 %97
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %98)
  br label %99

99:                                               ; preds = %95, %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !10
  br label %100

100:                                              ; preds = %123, %99
  %101 = load i32, ptr %20, align 4, !tbaa !10
  %102 = icmp slt i32 %101, 4
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %126

104:                                              ; preds = %100
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %21, i64 noundef 512)
  %105 = getelementptr inbounds %class.RNFlags, ptr %21, i32 0, i32 0
  %106 = load i64, ptr %105, align 8
  %107 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %106)
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %113

109:                                              ; preds = %104
  %110 = load i32, ptr %20, align 4, !tbaa !10
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [4 x %class.R2Point], ptr @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, i64 0, i64 %111
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) %112)
  br label %113

113:                                              ; preds = %109, %104
  %114 = load i32, ptr %17, align 4, !tbaa !10
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [6 x [4 x i32]], ptr @_ZZNK5R3Box4DrawE7RNFlagsE13surface_paths, i64 0, i64 %115
  %117 = load i32, ptr %20, align 4, !tbaa !10
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [4 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !10
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 %121
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %122)
  br label %123

123:                                              ; preds = %113
  %124 = load i32, ptr %20, align 4, !tbaa !10
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %20, align 4, !tbaa !10
  br label %100, !llvm.loop !12

126:                                              ; preds = %103
  call void @_Z12R3EndPolygonv()
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %17, align 4, !tbaa !10
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %17, align 4, !tbaa !10
  br label %78, !llvm.loop !14

130:                                              ; preds = %81
  br label %131

131:                                              ; preds = %130, %56
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %22, i64 noundef 1)
  %132 = getelementptr inbounds %class.RNFlags, ptr %22, i32 0, i32 0
  %133 = load i64, ptr %132, align 8
  %134 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %133)
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %152

136:                                              ; preds = %131
  call void @_Z11R3BeginLinev()
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !10
  br label %137

137:                                              ; preds = %148, %136
  %138 = load i32, ptr %23, align 4, !tbaa !10
  %139 = icmp slt i32 %138, 16
  br i1 %139, label %141, label %140

140:                                              ; preds = %137
  store i32 8, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %151

141:                                              ; preds = %137
  %142 = load i32, ptr %23, align 4, !tbaa !10
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [16 x i32], ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !10
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [8 x %class.R3Point], ptr %7, i64 0, i64 %146
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %147)
  br label %148

148:                                              ; preds = %141
  %149 = load i32, ptr %23, align 4, !tbaa !10
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %23, align 4, !tbaa !10
  br label %137, !llvm.loop !15

151:                                              ; preds = %140
  call void @_Z9R3EndLinev()
  br label %152

152:                                              ; preds = %151, %131
  call void @llvm.lifetime.end.p0(i64 192, ptr %7) #4
  ret void

153:                                              ; preds = %86, %82
  %154 = load ptr, ptr %5, align 8
  %155 = load i32, ptr %6, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157
}

declare void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3

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 = { "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 = { 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" }

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

@_ZZNK5R3Box4DrawE7RNFlagsE7normals = external hidden global [6 x %class.R3Vector], align 16
@_ZGVZNK5R3Box4DrawE7RNFlagsE7normals = external hidden global i64, align 8
@_ZZNK5R3Box4DrawE7RNFlagsE9texcoords = external hidden global [4 x %class.R2Point], align 16
@_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords = external hidden global i64, align 8
@_ZZNK5R3Box4DrawE7RNFlagsE13surface_paths = external hidden local_unnamed_addr global [6 x [4 x i32]], align 16
@_ZZNK5R3Box4DrawE7RNFlagsE12outline_path = external hidden local_unnamed_addr global [16 x i32], align 16

; 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 @_Z11R3BeginLinev() local_unnamed_addr #1

; 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 uwtable
declare dso_local void @_Z9R3EndLinev() 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

declare void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #3

; 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 #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK5R3Box4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 %1) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca [8 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.R3Point, align 8
  %10 = alloca %class.R3Point, align 8
  %11 = alloca %class.R3Point, align 8
  %12 = alloca %class.R3Point, align 8
  %13 = alloca %class.RNFlags, align 8
  %14 = alloca %class.RNFlags, align 8
  %15 = alloca %class.RNFlags, align 8
  %16 = alloca %class.RNFlags, align 8
  store i64 %1, ptr %3, align 8
  %17 = load atomic i8, ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE7normals acquire, align 8
  %18 = icmp eq i8 %17, 0
  br i1 %18, label %19, label %28, !prof !5

19:                                               ; preds = %2
  %20 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK5R3Box4DrawE7RNFlagsE7normals) #6
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %28, label %21

21:                                               ; preds = %19
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) @_ZZNK5R3Box4DrawE7RNFlagsE7normals, double noundef -1.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %22 unwind label %49

22:                                               ; preds = %21
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 24), double noundef 1.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %23 unwind label %49

23:                                               ; preds = %22
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 48), double noundef 0.000000e+00, double noundef -1.000000e+00, double noundef 0.000000e+00)
          to label %24 unwind label %49

24:                                               ; preds = %23
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 72), double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %25 unwind label %49

25:                                               ; preds = %24
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 96), double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef -1.000000e+00)
          to label %26 unwind label %49

26:                                               ; preds = %25
  invoke void @_ZN8R3VectorC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 120), double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %27 unwind label %49

27:                                               ; preds = %26
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK5R3Box4DrawE7RNFlagsE7normals) #6
  br label %28

28:                                               ; preds = %27, %19, %2
  %29 = load atomic i8, ptr @_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords acquire, align 8
  %30 = icmp eq i8 %29, 0
  br i1 %30, label %31, label %38, !prof !5

31:                                               ; preds = %28
  %32 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords) #6
  %.not17 = icmp eq i32 %32, 0
  br i1 %.not17, label %38, label %33

33:                                               ; preds = %31
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %34 unwind label %51

34:                                               ; preds = %33
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, i64 16), double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %35 unwind label %51

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

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

37:                                               ; preds = %36
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords) #6
  br label %38

38:                                               ; preds = %37, %31, %28
  call void @llvm.lifetime.start.p0(i64 192, 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)
  %.ptr.4 = getelementptr inbounds i8, ptr %4, i64 96
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %4, i64 120
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.5)
  %.ptr.6 = getelementptr inbounds i8, ptr %4, i64 144
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.6)
  %.ptr.7 = getelementptr inbounds i8, ptr %4, i64 168
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef 0)
  %39 = 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 @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef 1)
  %40 = 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 @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %7, ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef 3)
  %41 = 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 @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef 2)
  %42 = 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 @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef 4)
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.4, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef 5)
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.5, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #6
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef 7)
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.6, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #6
  call void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %12, ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef 6)
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.7, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #6
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %13, i64 noundef 2)
  %47 = load i64, ptr %13, align 8
  %48 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %47)
  %.not20 = icmp eq i32 %48, 0
  br i1 %.not20, label %.loopexit, label %.preheader

49:                                               ; preds = %26, %25, %24, %23, %22, %21
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %142

51:                                               ; preds = %36, %35, %34, %33
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %142

.preheader:                                       ; preds = %38, %85
  %indvars.iv = phi i64 [ %indvars.iv.next, %85 ], [ 0, %38 ]
  call void @_Z14R3BeginPolygonv()
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %14, i64 noundef 16)
  %53 = load i64, ptr %14, align 8
  %54 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %53)
  %.not22 = icmp eq i32 %54, 0
  br i1 %.not22, label %57, label %55

55:                                               ; preds = %.preheader
  %56 = getelementptr inbounds [6 x %class.R3Vector], ptr @_ZZNK5R3Box4DrawE7RNFlagsE7normals, i64 0, i64 %indvars.iv
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %56)
  br label %57

57:                                               ; preds = %55, %.preheader
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef 512)
  %58 = load i64, ptr %15, align 8
  %59 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %58)
  %.not23 = icmp eq i32 %59, 0
  br i1 %.not23, label %61, label %60

60:                                               ; preds = %57
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords)
  br label %61

61:                                               ; preds = %60, %57
  %62 = getelementptr inbounds [6 x [4 x i32]], ptr @_ZZNK5R3Box4DrawE7RNFlagsE13surface_paths, i64 0, i64 %indvars.iv, i64 0
  %63 = load i32, ptr %62, align 16, !tbaa !6
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %64
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %65)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef 512)
  %66 = load i64, ptr %15, align 8
  %67 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %66)
  %.not23.1 = icmp eq i32 %67, 0
  br i1 %.not23.1, label %69, label %68

68:                                               ; preds = %61
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, i64 16))
  br label %69

69:                                               ; preds = %68, %61
  %70 = getelementptr inbounds [6 x [4 x i32]], ptr @_ZZNK5R3Box4DrawE7RNFlagsE13surface_paths, i64 0, i64 %indvars.iv, i64 1
  %71 = load i32, ptr %70, align 4, !tbaa !6
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %72
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %73)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef 512)
  %74 = load i64, ptr %15, align 8
  %75 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %74)
  %.not23.2 = icmp eq i32 %75, 0
  br i1 %.not23.2, label %77, label %76

76:                                               ; preds = %69
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, i64 32))
  br label %77

77:                                               ; preds = %76, %69
  %78 = getelementptr inbounds [6 x [4 x i32]], ptr @_ZZNK5R3Box4DrawE7RNFlagsE13surface_paths, i64 0, i64 %indvars.iv, i64 2
  %79 = load i32, ptr %78, align 8, !tbaa !6
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %80
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %81)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef 512)
  %82 = load i64, ptr %15, align 8
  %83 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %82)
  %.not23.3 = icmp eq i32 %83, 0
  br i1 %.not23.3, label %85, label %84

84:                                               ; preds = %77
  call void @_Z19R3LoadTextureCoordsRK7R2Point(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE9texcoords, i64 48))
  br label %85

85:                                               ; preds = %84, %77
  %86 = getelementptr inbounds [6 x [4 x i32]], ptr @_ZZNK5R3Box4DrawE7RNFlagsE13surface_paths, i64 0, i64 %indvars.iv, i64 3
  %87 = load i32, ptr %86, align 4, !tbaa !6
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %88
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %89)
  call void @_Z12R3EndPolygonv()
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 6
  br i1 %exitcond.not, label %.loopexit, label %.preheader, !llvm.loop !10

.loopexit:                                        ; preds = %85, %38
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef 1)
  %90 = load i64, ptr %16, align 8
  %91 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %90)
  %.not21 = icmp eq i32 %91, 0
  br i1 %.not21, label %141, label %92

92:                                               ; preds = %.loopexit
  call void @_Z11R3BeginLinev()
  %93 = load i32, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, align 16, !tbaa !6
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %94
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %95)
  %96 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 4), align 4, !tbaa !6
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %97
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %98)
  %99 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 8), align 8, !tbaa !6
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %100
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %101)
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 12), align 4, !tbaa !6
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %103
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %104)
  %105 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 16), align 16, !tbaa !6
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %106
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %107)
  %108 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 20), align 4, !tbaa !6
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %109
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %110)
  %111 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 24), align 8, !tbaa !6
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %112
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %113)
  %114 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 28), align 4, !tbaa !6
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %115
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %116)
  %117 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 32), align 16, !tbaa !6
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %118
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %119)
  %120 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 36), align 4, !tbaa !6
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %121
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %122)
  %123 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 40), align 8, !tbaa !6
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %124
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %125)
  %126 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 44), align 4, !tbaa !6
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %127
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %128)
  %129 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 48), align 16, !tbaa !6
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %130
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %131)
  %132 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 52), align 4, !tbaa !6
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %133
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %134)
  %135 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 56), align 8, !tbaa !6
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %136
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %137)
  %138 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZNK5R3Box4DrawE7RNFlagsE12outline_path, i64 60), align 4, !tbaa !6
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [8 x %class.R3Point], ptr %4, i64 0, i64 %139
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %140)
  call void @_Z9R3EndLinev()
  br label %141

141:                                              ; preds = %92, %.loopexit
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %4) #6
  ret void

142:                                              ; preds = %51, %49
  %_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords.sink = phi ptr [ @_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords, %51 ], [ @_ZGVZNK5R3Box4DrawE7RNFlagsE7normals, %49 ]
  %.pn = phi { ptr, i32 } [ %52, %51 ], [ %50, %49 ]
  tail call void @__cxa_guard_abort(ptr nonnull %_ZGVZNK5R3Box4DrawE7RNFlagsE9texcoords.sink) #6
  resume { ptr, i32 } %.pn
}

declare void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3

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 = { "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 = { 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 #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}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


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