; LLVM IR from niessner/Matterport :: code/gaps/apps/mpview/mp.ll (ZNK9MPSurface11DrawPolygonE7RNFlags)

; 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.RNFlags = type { i64 }
%struct.MPSurface = type { ptr, i32, ptr, i32, %class.RNArray.5, %class.R3Point, %class.R3Vector, %class.R3Box, ptr }
%class.RNArray.5 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%struct.MPVertex = type { ptr, i32, ptr, i32, %class.R3Point, %class.R3Vector, ptr }

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

declare void @glDisable(i32 noundef) #2

declare void @glEnable(i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

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

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

declare void @glBegin(i32 noundef) #2

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

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

declare void @glEnd() #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8MPVertex12DrawPositionE7RNFlags(ptr noundef nonnull align 8 dereferenceable(88), i64) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIP8MPVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9MPSurface11DrawPolygonE7RNFlags(ptr noundef nonnull align 8 dereferenceable(160) %0, i64 %1) #5 align 2 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %class.RNFlags, align 8
  %13 = getelementptr inbounds %class.RNFlags, ptr %3, i32 0, i32 0
  store i64 %1, ptr %13, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  %15 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %16 = and i64 %15, 4
  %17 = icmp ne i64 %16, 0
  br i1 %17, label %18, label %54

18:                                               ; preds = %2
  %19 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %20 = and i64 %19, 2147483648
  %21 = icmp ne i64 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %18
  call void @glDisable(i32 noundef 2896)
  br label %24

23:                                               ; preds = %18
  call void @glEnable(i32 noundef 2896)
  br label %24

24:                                               ; preds = %23, %22
  %25 = getelementptr inbounds %struct.MPSurface, ptr %14, i32 0, i32 6
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %25)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %26 = call ptr @gluNewTess()
  store ptr %26, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gluTessCallback(ptr noundef %27, i32 noundef 100100, ptr noundef @glBegin)
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gluTessCallback(ptr noundef %28, i32 noundef 100101, ptr noundef @glVertex3dv)
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gluTessCallback(ptr noundef %29, i32 noundef 100102, ptr noundef @glEnd)
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gluTessBeginPolygon(ptr noundef %30, ptr noundef null)
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gluTessBeginContour(ptr noundef %31)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %47, %24
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = getelementptr inbounds %struct.MPSurface, ptr %14, i32 0, i32 4
  %35 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %34)
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %50

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %39 = getelementptr inbounds %struct.MPSurface, ptr %14, i32 0, i32 4
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = call noundef ptr @_ZNK7RNArrayIP8MPVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %39, i32 noundef %40)
  %42 = getelementptr inbounds %struct.MPVertex, ptr %41, i32 0, i32 4
  %43 = call noundef ptr @_ZNK7R3Point6CoordsEv(ptr noundef nonnull align 8 dereferenceable(24) %42)
  store ptr %43, ptr %7, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  call void @gluTessVertex(ptr noundef %44, ptr noundef %45, ptr noundef %46)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %47

47:                                               ; preds = %38
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %6, align 4, !tbaa !9
  br label %32, !llvm.loop !11

50:                                               ; preds = %37
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gluTessEndContour(ptr noundef %51)
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gluTessEndPolygon(ptr noundef %52)
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gluDeleteTess(ptr noundef %53)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %54

54:                                               ; preds = %50, %2
  %55 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %56 = and i64 %55, 2
  %57 = icmp ne i64 %56, 0
  br i1 %57, label %58, label %75

58:                                               ; preds = %54
  call void @glDisable(i32 noundef 2896)
  call void @glBegin(i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %71, %58
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = getelementptr inbounds %struct.MPSurface, ptr %14, i32 0, i32 4
  %62 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %61)
  %63 = icmp slt i32 %60, %62
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %66 = getelementptr inbounds %struct.MPSurface, ptr %14, i32 0, i32 4
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = call noundef ptr @_ZNK7RNArrayIP8MPVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %66, i32 noundef %67)
  store ptr %68, ptr %9, align 8, !tbaa !5
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.MPVertex, ptr %69, i32 0, i32 4
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %70)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %71

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

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

75:                                               ; preds = %74, %54
  %76 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %77 = and i64 %76, 1
  %78 = icmp ne i64 %77, 0
  br i1 %78, label %79, label %97

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %93, %79
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = getelementptr inbounds %struct.MPSurface, ptr %14, i32 0, i32 4
  %83 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %82)
  %84 = icmp slt i32 %81, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %96

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %87 = getelementptr inbounds %struct.MPSurface, ptr %14, i32 0, i32 4
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = call noundef ptr @_ZNK7RNArrayIP8MPVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %87, i32 noundef %88)
  store ptr %89, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %3, i64 8, i1 false), !tbaa.struct !14
  %91 = getelementptr inbounds %class.RNFlags, ptr %12, i32 0, i32 0
  %92 = load i64, ptr %91, align 8
  call void @_ZNK8MPVertex12DrawPositionE7RNFlags(ptr noundef nonnull align 8 dereferenceable(88) %90, i64 %92)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %93

93:                                               ; preds = %86
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %10, align 4, !tbaa !9
  br label %80, !llvm.loop !17

96:                                               ; preds = %85
  br label %97

97:                                               ; preds = %96, %75
  ret void
}

declare ptr @gluNewTess() #2

declare void @gluTessCallback(ptr noundef, i32 noundef, ptr noundef) #2

declare void @glVertex3dv(ptr noundef) #2

declare void @gluTessBeginPolygon(ptr noundef, ptr noundef) #2

declare void @gluTessBeginContour(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIP8MPVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

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

declare void @gluTessVertex(ptr noundef, ptr noundef, ptr noundef) #2

declare void @gluTessEndContour(ptr noundef) #2

declare void @gluTessEndPolygon(ptr noundef) #2

declare void @gluDeleteTess(ptr noundef) #2

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


; 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.RNFlags = type { i64 }

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

declare void @glDisable(i32 noundef) local_unnamed_addr #1

declare void @glEnable(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

declare void @glBegin(i32 noundef) #1

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

declare void @glEnd() #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8MPVertex12DrawPositionE7RNFlags(ptr noundef nonnull align 8 dereferenceable(88), i64) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIP8MPVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9MPSurface11DrawPolygonE7RNFlags(ptr noundef nonnull align 8 dereferenceable(160) %0, i64 %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %class.RNFlags, align 8
  store i64 %1, ptr %3, align 8
  %4 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %5 = and i64 %4, 4
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %23, label %6

6:                                                ; preds = %2
  %7 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %8 = and i64 %7, 2147483648
  %.not24 = icmp eq i64 %8, 0
  br i1 %.not24, label %10, label %9

9:                                                ; preds = %6
  call void @glDisable(i32 noundef 2896)
  br label %11

10:                                               ; preds = %6
  call void @glEnable(i32 noundef 2896)
  br label %11

11:                                               ; preds = %10, %9
  %12 = getelementptr inbounds i8, ptr %0, i64 72
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %13 = call ptr @gluNewTess()
  call void @gluTessCallback(ptr noundef %13, i32 noundef 100100, ptr noundef nonnull @glBegin)
  call void @gluTessCallback(ptr noundef %13, i32 noundef 100101, ptr noundef nonnull @glVertex3dv)
  call void @gluTessCallback(ptr noundef %13, i32 noundef 100102, ptr noundef nonnull @glEnd)
  call void @gluTessBeginPolygon(ptr noundef %13, ptr noundef null)
  call void @gluTessBeginContour(ptr noundef %13)
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %11
  call void @gluTessEndContour(ptr noundef %13)
  call void @gluTessEndPolygon(ptr noundef %13)
  call void @gluDeleteTess(ptr noundef %13)
  br label %23

.lr.ph:                                           ; preds = %11, %.lr.ph
  %.027 = phi i32 [ %20, %.lr.ph ], [ 0, %11 ]
  %17 = call noundef ptr @_ZNK7RNArrayIP8MPVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef %.027)
  %18 = getelementptr inbounds i8, ptr %17, i64 32
  %19 = call noundef ptr @_ZNK7R3Point6CoordsEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @gluTessVertex(ptr noundef %13, ptr noundef %19, ptr noundef %19)
  %20 = add nuw nsw i32 %.027, 1
  %21 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !5

23:                                               ; preds = %._crit_edge, %2
  %24 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %25 = and i64 %24, 2
  %.not25 = icmp eq i64 %25, 0
  br i1 %.not25, label %35, label %26

26:                                               ; preds = %23
  call void @glDisable(i32 noundef 2896)
  call void @glBegin(i32 noundef 2)
  %27 = getelementptr inbounds i8, ptr %0, i64 32
  %28 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %27)
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph30, label %._crit_edge31

._crit_edge31:                                    ; preds = %.lr.ph30, %26
  call void @glEnd()
  br label %35

.lr.ph30:                                         ; preds = %26, %.lr.ph30
  %.02228 = phi i32 [ %32, %.lr.ph30 ], [ 0, %26 ]
  %30 = call noundef ptr @_ZNK7RNArrayIP8MPVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %27, i32 noundef %.02228)
  %31 = getelementptr inbounds i8, ptr %30, i64 32
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %31)
  %32 = add nuw nsw i32 %.02228, 1
  %33 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %27)
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %.lr.ph30, label %._crit_edge31, !llvm.loop !7

35:                                               ; preds = %._crit_edge31, %23
  %36 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %37 = and i64 %36, 1
  %.not26 = icmp eq i64 %37, 0
  br i1 %.not26, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %35
  %38 = getelementptr inbounds i8, ptr %0, i64 32
  %39 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %38)
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph33, label %.loopexit

.lr.ph33:                                         ; preds = %.preheader, %.lr.ph33
  %.02332 = phi i32 [ %42, %.lr.ph33 ], [ 0, %.preheader ]
  %41 = call noundef ptr @_ZNK7RNArrayIP8MPVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %38, i32 noundef %.02332)
  %.sroa.0.0.copyload = load i64, ptr %3, align 8, !tbaa !8
  call void @_ZNK8MPVertex12DrawPositionE7RNFlags(ptr noundef nonnull align 8 dereferenceable(88) %41, i64 %.sroa.0.0.copyload)
  %42 = add nuw nsw i32 %.02332, 1
  %43 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %38)
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %.lr.ph33, label %.loopexit, !llvm.loop !12

.loopexit:                                        ; preds = %.lr.ph33, %.preheader, %35
  ret void
}

declare ptr @gluNewTess() local_unnamed_addr #1

declare void @gluTessCallback(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @glVertex3dv(ptr noundef) #1

declare void @gluTessBeginPolygon(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @gluTessBeginContour(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIP8MPVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

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

declare void @gluTessVertex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @gluTessEndContour(ptr noundef) local_unnamed_addr #1

declare void @gluTessEndPolygon(ptr noundef) local_unnamed_addr #1

declare void @gluDeleteTess(ptr noundef) local_unnamed_addr #1

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


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