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

; 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.MPSegment = type <{ ptr, i32, [4 x i8], ptr, i32, [4 x i8], ptr, %class.RNArray.12, double, %class.R3Point, %class.R3Box, i32, [4 x i8] }>
%class.RNArray.12 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Point = type { [3 x double] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }

@R3mesh_mark = external global i32, align 4

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

; 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 nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9MPSegment8DrawMeshE7RNFlags(ptr noundef nonnull align 8 dereferenceable(148) %0, i64 %1) #4 align 2 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %class.RNFlags, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %class.RNFlags, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca %class.RNFlags, align 8
  %21 = getelementptr inbounds %class.RNFlags, ptr %3, i32 0, i32 0
  store i64 %1, ptr %21, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %4, align 8
  %23 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = icmp ne ptr %24, null
  br i1 %25, label %27, label %26

26:                                               ; preds = %2
  br label %195

27:                                               ; preds = %2
  %28 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %29 = and i64 %28, 4
  %30 = icmp ne i64 %29, 0
  br i1 %30, label %31, label %84

31:                                               ; preds = %27
  %32 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %33 = and i64 %32, 2147483648
  %34 = icmp ne i64 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %31
  call void @glDisable(i32 noundef 2896)
  br label %37

36:                                               ; preds = %31
  call void @glEnable(i32 noundef 2896)
  br label %37

37:                                               ; preds = %36, %35
  call void @glBegin(i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !19
  br label %38

38:                                               ; preds = %80, %37
  %39 = load i32, ptr %5, align 4, !tbaa !19
  %40 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 7
  %41 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %40)
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %83

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %45 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 7
  %46 = load i32, ptr %5, align 4, !tbaa !19
  %47 = call noundef ptr @_ZNK7RNArrayIP10R3MeshFaceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %45, i32 noundef %46)
  store ptr %47, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %49, ptr noundef %50)
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %51)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !19
  br label %52

52:                                               ; preds = %76, %44
  %53 = load i32, ptr %8, align 4, !tbaa !19
  %54 = icmp slt i32 %53, 3
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %79

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %57 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !19
  %61 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %58, ptr noundef %59, i32 noundef %60)
  store ptr %61, ptr %9, align 8, !tbaa !5
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 1073741824)
  %62 = getelementptr inbounds %class.RNFlags, ptr %10, i32 0, i32 0
  %63 = load i64, ptr %62, align 8
  %64 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %63)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %71

66:                                               ; preds = %56
  %67 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %68, ptr noundef %69)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %70)
  br label %71

71:                                               ; preds = %66, %56
  %72 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %73, ptr noundef %74)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %75)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %76

76:                                               ; preds = %71
  %77 = load i32, ptr %8, align 4, !tbaa !19
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !19
  br label %52, !llvm.loop !20

79:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %5, align 4, !tbaa !19
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %5, align 4, !tbaa !19
  br label %38, !llvm.loop !22

83:                                               ; preds = %43
  call void @glEnd()
  br label %84

84:                                               ; preds = %83, %27
  %85 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %86 = and i64 %85, 2
  %87 = icmp ne i64 %86, 0
  br i1 %87, label %88, label %131

88:                                               ; preds = %84
  call void @glDisable(i32 noundef 2896)
  call void @glPolygonMode(i32 noundef 1032, i32 noundef 6913)
  call void @glBegin(i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !19
  br label %89

89:                                               ; preds = %127, %88
  %90 = load i32, ptr %11, align 4, !tbaa !19
  %91 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 7
  %92 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %91)
  %93 = icmp slt i32 %90, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %89
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %130

95:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %96 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 7
  %97 = load i32, ptr %11, align 4, !tbaa !19
  %98 = call noundef ptr @_ZNK7RNArrayIP10R3MeshFaceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %96, i32 noundef %97)
  store ptr %98, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !19
  br label %99

99:                                               ; preds = %123, %95
  %100 = load i32, ptr %13, align 4, !tbaa !19
  %101 = icmp slt i32 %100, 3
  br i1 %101, label %103, label %102

102:                                              ; preds = %99
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %126

103:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %104 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = load i32, ptr %13, align 4, !tbaa !19
  %108 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %105, ptr noundef %106, i32 noundef %107)
  store ptr %108, ptr %14, align 8, !tbaa !5
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef 1073741824)
  %109 = getelementptr inbounds %class.RNFlags, ptr %15, i32 0, i32 0
  %110 = load i64, ptr %109, align 8
  %111 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %110)
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %118

113:                                              ; preds = %103
  %114 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %115, ptr noundef %116)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %117)
  br label %118

118:                                              ; preds = %113, %103
  %119 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  %121 = load ptr, ptr %14, align 8, !tbaa !5
  %122 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %120, ptr noundef %121)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %122)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %123

123:                                              ; preds = %118
  %124 = load i32, ptr %13, align 4, !tbaa !19
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %13, align 4, !tbaa !19
  br label %99, !llvm.loop !23

126:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %11, align 4, !tbaa !19
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %11, align 4, !tbaa !19
  br label %89, !llvm.loop !24

130:                                              ; preds = %94
  call void @glEnd()
  call void @glPolygonMode(i32 noundef 1032, i32 noundef 6914)
  br label %131

131:                                              ; preds = %130, %84
  %132 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %133 = and i64 %132, 1
  %134 = icmp ne i64 %133, 0
  br i1 %134, label %135, label %195

135:                                              ; preds = %131
  %136 = load i32, ptr @R3mesh_mark, align 4, !tbaa !19
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr @R3mesh_mark, align 4, !tbaa !19
  call void @glDisable(i32 noundef 2896)
  call void @glBegin(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !19
  br label %138

138:                                              ; preds = %191, %135
  %139 = load i32, ptr %16, align 4, !tbaa !19
  %140 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 7
  %141 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %140)
  %142 = icmp slt i32 %139, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %138
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %194

144:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %145 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 7
  %146 = load i32, ptr %16, align 4, !tbaa !19
  %147 = call noundef ptr @_ZNK7RNArrayIP10R3MeshFaceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %145, i32 noundef %146)
  store ptr %147, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !19
  br label %148

148:                                              ; preds = %187, %144
  %149 = load i32, ptr %18, align 4, !tbaa !19
  %150 = icmp slt i32 %149, 3
  br i1 %150, label %152, label %151

151:                                              ; preds = %148
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %190

152:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %153 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %154 = load ptr, ptr %153, align 8, !tbaa !9
  %155 = load ptr, ptr %17, align 8, !tbaa !5
  %156 = load i32, ptr %18, align 4, !tbaa !19
  %157 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %154, ptr noundef %155, i32 noundef %156)
  store ptr %157, ptr %19, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %159 = load ptr, ptr %158, align 8, !tbaa !9
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  %161 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %159, ptr noundef %160)
  %162 = load i32, ptr @R3mesh_mark, align 4, !tbaa !19
  %163 = icmp eq i32 %161, %162
  br i1 %163, label %164, label %165

164:                                              ; preds = %152
  store i32 19, ptr %6, align 4
  br label %184

165:                                              ; preds = %152
  %166 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %167 = load ptr, ptr %166, align 8, !tbaa !9
  %168 = load ptr, ptr %19, align 8, !tbaa !5
  %169 = load i32, ptr @R3mesh_mark, align 4, !tbaa !19
  call void @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %167, ptr noundef %168, i32 noundef %169)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %20, i64 noundef 1073741824)
  %170 = getelementptr inbounds %class.RNFlags, ptr %20, i32 0, i32 0
  %171 = load i64, ptr %170, align 8
  %172 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %171)
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %179

174:                                              ; preds = %165
  %175 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %176 = load ptr, ptr %175, align 8, !tbaa !9
  %177 = load ptr, ptr %19, align 8, !tbaa !5
  %178 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %176, ptr noundef %177)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %178)
  br label %179

179:                                              ; preds = %174, %165
  %180 = getelementptr inbounds %struct.MPSegment, ptr %22, i32 0, i32 6
  %181 = load ptr, ptr %180, align 8, !tbaa !9
  %182 = load ptr, ptr %19, align 8, !tbaa !5
  %183 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %181, ptr noundef %182)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %183)
  store i32 0, ptr %6, align 4
  br label %184

184:                                              ; preds = %179, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %185 = load i32, ptr %6, align 4
  switch i32 %185, label %196 [
    i32 0, label %186
    i32 19, label %187
  ]

186:                                              ; preds = %184
  br label %187

187:                                              ; preds = %186, %184
  %188 = load i32, ptr %18, align 4, !tbaa !19
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %18, align 4, !tbaa !19
  br label %148, !llvm.loop !25

190:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %16, align 4, !tbaa !19
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %16, align 4, !tbaa !19
  br label %138, !llvm.loop !26

194:                                              ; preds = %143
  call void @glEnd()
  br label %195

195:                                              ; preds = %194, %131, %26
  ret void

196:                                              ; preds = %184
  unreachable
}

declare void @glBegin(i32 noundef) #2

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

; 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 noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #1 align 2

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

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

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

; 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 noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #0 align 2

declare void @glEnd() #2

declare void @glPolygonMode(i32 noundef, i32 noundef) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) #0 align 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 = { 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 = { "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 = { 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 = { 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, !6, i64 32}
!10 = !{!"_ZTS9MPSegment", !6, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !12, i64 40, !14, i64 56, !15, i64 64, !16, i64 88, !11, i64 144}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS7RNArrayIP10R3MeshFaceE", !13, i64 0}
!13 = !{!"_ZTS8RNVArray", !6, i64 0, !11, i64 8, !11, i64 12}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTS7R3Point", !7, i64 0}
!16 = !{!"_ZTS5R3Box", !17, i64 0, !15, i64 8, !15, i64 32}
!17 = !{!"_ZTS7R3Solid", !18, i64 0}
!18 = !{!"_ZTS7R3Shape"}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !21}


; 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 }

@R3mesh_mark = external local_unnamed_addr global i32, align 4

; 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

; 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 nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #0 align 2

declare void @glDisable(i32 noundef) local_unnamed_addr #2

declare void @glEnable(i32 noundef) local_unnamed_addr #2

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9MPSegment8DrawMeshE7RNFlags(ptr noundef nonnull align 8 dereferenceable(148) %0, i64 %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca %class.RNFlags, align 8
  %5 = alloca %class.RNFlags, align 8
  %6 = alloca %class.RNFlags, align 8
  store i64 %1, ptr %3, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %162, label %9

9:                                                ; preds = %2
  %10 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %11 = and i64 %10, 4
  %.not36 = icmp eq i64 %11, 0
  br i1 %.not36, label %57, label %12

12:                                               ; preds = %9
  %13 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %14 = and i64 %13, 2147483648
  %.not37 = icmp eq i64 %14, 0
  br i1 %.not37, label %16, label %15

15:                                               ; preds = %12
  call void @glDisable(i32 noundef 2896)
  br label %17

16:                                               ; preds = %12
  call void @glEnable(i32 noundef 2896)
  br label %17

17:                                               ; preds = %16, %15
  call void @glBegin(i32 noundef 4)
  %18 = getelementptr inbounds i8, ptr %0, i64 40
  %19 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %51, %17
  call void @glEnd()
  br label %57

.lr.ph:                                           ; preds = %17, %51
  %.044 = phi i32 [ %54, %51 ], [ 0, %17 ]
  %21 = call noundef ptr @_ZNK7RNArrayIP10R3MeshFaceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %18, i32 noundef %.044)
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh10FaceNormalEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %22, ptr noundef %21)
  call void @_Z12R3LoadNormalRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %24, ptr noundef %21, i32 noundef 0)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 1073741824)
  %26 = load i64, ptr %4, align 8
  %27 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %26)
  %.not42 = icmp eq i32 %27, 0
  br i1 %.not42, label %31, label %28

28:                                               ; preds = %.lr.ph
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %29, ptr noundef %25)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %30)
  br label %31

31:                                               ; preds = %28, %.lr.ph
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %32, ptr noundef %25)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %34, ptr noundef %21, i32 noundef 1)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 1073741824)
  %36 = load i64, ptr %4, align 8
  %37 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %36)
  %.not42.1 = icmp eq i32 %37, 0
  br i1 %.not42.1, label %41, label %38

38:                                               ; preds = %31
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %39, ptr noundef %35)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %40)
  br label %41

41:                                               ; preds = %38, %31
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %42, ptr noundef %35)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %43)
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %44, ptr noundef %21, i32 noundef 2)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 1073741824)
  %46 = load i64, ptr %4, align 8
  %47 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %46)
  %.not42.2 = icmp eq i32 %47, 0
  br i1 %.not42.2, label %51, label %48

48:                                               ; preds = %41
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %49, ptr noundef %45)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %50)
  br label %51

51:                                               ; preds = %48, %41
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %52, ptr noundef %45)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %53)
  %54 = add nuw nsw i32 %.044, 1
  %55 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %.lr.ph, label %._crit_edge, !llvm.loop !18

57:                                               ; preds = %._crit_edge, %9
  %58 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %59 = and i64 %58, 2
  %.not38 = icmp eq i64 %59, 0
  br i1 %.not38, label %98, label %60

60:                                               ; preds = %57
  call void @glDisable(i32 noundef 2896)
  call void @glPolygonMode(i32 noundef 1032, i32 noundef 6913)
  call void @glBegin(i32 noundef 4)
  %61 = getelementptr inbounds i8, ptr %0, i64 40
  %62 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %61)
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph48, label %._crit_edge49

._crit_edge49:                                    ; preds = %92, %60
  call void @glEnd()
  call void @glPolygonMode(i32 noundef 1032, i32 noundef 6914)
  br label %98

.lr.ph48:                                         ; preds = %60, %92
  %.03446 = phi i32 [ %95, %92 ], [ 0, %60 ]
  %64 = call noundef ptr @_ZNK7RNArrayIP10R3MeshFaceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %61, i32 noundef %.03446)
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %65, ptr noundef %64, i32 noundef 0)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 1073741824)
  %67 = load i64, ptr %5, align 8
  %68 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %67)
  %.not41 = icmp eq i32 %68, 0
  br i1 %.not41, label %72, label %69

69:                                               ; preds = %.lr.ph48
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %70, ptr noundef %66)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %71)
  br label %72

72:                                               ; preds = %69, %.lr.ph48
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %73, ptr noundef %66)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %74)
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %75, ptr noundef %64, i32 noundef 1)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 1073741824)
  %77 = load i64, ptr %5, align 8
  %78 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %77)
  %.not41.1 = icmp eq i32 %78, 0
  br i1 %.not41.1, label %82, label %79

79:                                               ; preds = %72
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %80, ptr noundef %76)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %81)
  br label %82

82:                                               ; preds = %79, %72
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %83, ptr noundef %76)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %84)
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %85, ptr noundef %64, i32 noundef 2)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 1073741824)
  %87 = load i64, ptr %5, align 8
  %88 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %87)
  %.not41.2 = icmp eq i32 %88, 0
  br i1 %.not41.2, label %92, label %89

89:                                               ; preds = %82
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %90, ptr noundef %86)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %91)
  br label %92

92:                                               ; preds = %89, %82
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %93, ptr noundef %86)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %94)
  %95 = add nuw nsw i32 %.03446, 1
  %96 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %61)
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %.lr.ph48, label %._crit_edge49, !llvm.loop !20

98:                                               ; preds = %._crit_edge49, %57
  %99 = call noundef i64 @_ZNK7RNFlagscvmEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %100 = and i64 %99, 1
  %.not39 = icmp eq i64 %100, 0
  br i1 %.not39, label %162, label %101

101:                                              ; preds = %98
  %102 = load i32, ptr @R3mesh_mark, align 4, !tbaa !21
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr @R3mesh_mark, align 4, !tbaa !21
  call void @glDisable(i32 noundef 2896)
  call void @glBegin(i32 noundef 0)
  %104 = getelementptr inbounds i8, ptr %0, i64 40
  %105 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %104)
  %106 = icmp sgt i32 %105, 0
  br i1 %106, label %.lr.ph53, label %._crit_edge54

._crit_edge54:                                    ; preds = %158, %101
  call void @glEnd()
  br label %162

.lr.ph53:                                         ; preds = %101, %158
  %.03151 = phi i32 [ %159, %158 ], [ 0, %101 ]
  %107 = call noundef ptr @_ZNK7RNArrayIP10R3MeshFaceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %104, i32 noundef %.03151)
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %108, ptr noundef %107, i32 noundef 0)
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %110, ptr noundef %109)
  %112 = load i32, ptr @R3mesh_mark, align 4, !tbaa !21
  %113 = icmp eq i32 %111, %112
  br i1 %113, label %124, label %114

114:                                              ; preds = %.lr.ph53
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %115, ptr noundef %109, i32 noundef %112)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 1073741824)
  %116 = load i64, ptr %6, align 8
  %117 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %116)
  %.not40 = icmp eq i32 %117, 0
  br i1 %.not40, label %121, label %118

118:                                              ; preds = %114
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %119, ptr noundef %109)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %120)
  br label %121

121:                                              ; preds = %118, %114
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %122, ptr noundef %109)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %123)
  br label %124

124:                                              ; preds = %.lr.ph53, %121
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %125, ptr noundef %107, i32 noundef 1)
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %127, ptr noundef %126)
  %129 = load i32, ptr @R3mesh_mark, align 4, !tbaa !21
  %130 = icmp eq i32 %128, %129
  br i1 %130, label %141, label %131

131:                                              ; preds = %124
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %132, ptr noundef %126, i32 noundef %129)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 1073741824)
  %133 = load i64, ptr %6, align 8
  %134 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %133)
  %.not40.1 = icmp eq i32 %134, 0
  br i1 %.not40.1, label %138, label %135

135:                                              ; preds = %131
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %136, ptr noundef %126)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %137)
  br label %138

138:                                              ; preds = %135, %131
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %139, ptr noundef %126)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %140)
  br label %141

141:                                              ; preds = %138, %124
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %142, ptr noundef %107, i32 noundef 2)
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = call noundef i32 @_ZNK6R3Mesh10VertexMarkEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %144, ptr noundef %143)
  %146 = load i32, ptr @R3mesh_mark, align 4, !tbaa !21
  %147 = icmp eq i32 %145, %146
  br i1 %147, label %158, label %148

148:                                              ; preds = %141
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272) %149, ptr noundef %143, i32 noundef %146)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 1073741824)
  %150 = load i64, ptr %6, align 8
  %151 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %150)
  %.not40.2 = icmp eq i32 %151, 0
  br i1 %.not40.2, label %155, label %152

152:                                              ; preds = %148
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %153, ptr noundef %143)
  call void @_Z9RNLoadRgbRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(24) %154)
  br label %155

155:                                              ; preds = %152, %148
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %156, ptr noundef %143)
  call void @_Z11R3LoadPointRK7R3Point(ptr noundef nonnull align 8 dereferenceable(24) %157)
  br label %158

158:                                              ; preds = %155, %141
  %159 = add nuw nsw i32 %.03151, 1
  %160 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %104)
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %.lr.ph53, label %._crit_edge54, !llvm.loop !22

162:                                              ; preds = %2, %._crit_edge54, %98
  ret void
}

declare void @glBegin(i32 noundef) local_unnamed_addr #2

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

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

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

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

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

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

declare void @glEnd() local_unnamed_addr #2

declare void @glPolygonMode(i32 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6R3Mesh13SetVertexMarkEP12R3MeshVertexi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef, i32 noundef) local_unnamed_addr #0 align 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 = { 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 = { "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 = !{!6, !7, i64 32}
!6 = !{!"_ZTS9MPSegment", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !11, i64 40, !13, i64 56, !14, i64 64, !15, i64 88, !10, i64 144}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS7RNArrayIP10R3MeshFaceE", !12, i64 0}
!12 = !{!"_ZTS8RNVArray", !7, i64 0, !10, i64 8, !10, i64 12}
!13 = !{!"double", !8, i64 0}
!14 = !{!"_ZTS7R3Point", !8, i64 0}
!15 = !{!"_ZTS5R3Box", !16, i64 0, !14, i64 8, !14, i64 32}
!16 = !{!"_ZTS7R3Solid", !17, i64 0}
!17 = !{!"_ZTS7R3Shape"}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!10, !10, i64 0}
!22 = distinct !{!22, !19}


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