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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R2Point = type { [2 x double] }
%class.RNRgb = type { [3 x double] }
%class.R3Point = type { [3 x double] }

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

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

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

; 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) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6R3Mesh19VertexTextureCoordsEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #4 align 2

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272), i32 noundef) #0 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) #4 align 2

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #5

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

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

declare void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK7R2Point(ptr dead_on_unwind noalias writable sret(%class.R2Point) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh14SubdivideFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0) #7 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %class.R3Point, align 8
  %21 = alloca %class.R2Point, align 8
  %22 = alloca %class.R2Point, align 8
  %23 = alloca %class.R2Point, align 8
  %24 = alloca %class.RNRgb, align 8
  %25 = alloca %class.RNRgb, align 8
  %26 = alloca %class.RNRgb, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %33 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  %34 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %33)
  store i32 %34, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %35 = call noundef i32 @_ZNK6R3Mesh6NEdgesEv(ptr noundef nonnull align 8 dereferenceable(272) %33)
  store i32 %35, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %36 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %33)
  store i32 %36, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = mul nsw i32 %37, 4
  %39 = mul nsw i32 %38, 3
  %40 = sext i32 %39 to i64
  %41 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %40, i64 4)
  %42 = extractvalue { i64, i1 } %41, 1
  %43 = extractvalue { i64, i1 } %41, 0
  %44 = select i1 %42, i64 -1, i64 %43
  %45 = call noalias noundef nonnull ptr @_Znam(i64 noundef %44) #9
  store ptr %45, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %180, %1
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %183

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = call noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %33, i32 noundef %52)
  store ptr %53, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %54, i32 noundef 0)
  store ptr %55, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %56, i32 noundef 1)
  store ptr %57, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %58, i32 noundef 2)
  store ptr %59, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %60, i32 noundef 0)
  store ptr %61, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %62, i32 noundef 1)
  store ptr %63, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %64, i32 noundef 2)
  store ptr %65, ptr %14, align 8, !tbaa !5
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %66)
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = mul nsw i32 %69, 12
  %71 = add nsw i32 %70, 0
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %68, i64 %72
  store i32 %67, ptr %73, align 4, !tbaa !9
  %74 = load i32, ptr %5, align 4, !tbaa !9
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %75)
  %77 = add nsw i32 %74, %76
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = mul nsw i32 %79, 12
  %81 = add nsw i32 %80, 1
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr %78, i64 %82
  store i32 %77, ptr %83, align 4, !tbaa !9
  %84 = load i32, ptr %5, align 4, !tbaa !9
  %85 = load ptr, ptr %14, align 8, !tbaa !5
  %86 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %85)
  %87 = add nsw i32 %84, %86
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = mul nsw i32 %89, 12
  %91 = add nsw i32 %90, 2
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr %88, i64 %92
  store i32 %87, ptr %93, align 4, !tbaa !9
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %94)
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = load i32, ptr %7, align 4, !tbaa !9
  %98 = mul nsw i32 %97, 12
  %99 = add nsw i32 %98, 3
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %96, i64 %100
  store i32 %95, ptr %101, align 4, !tbaa !9
  %102 = load i32, ptr %5, align 4, !tbaa !9
  %103 = load ptr, ptr %13, align 8, !tbaa !5
  %104 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %103)
  %105 = add nsw i32 %102, %104
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = load i32, ptr %7, align 4, !tbaa !9
  %108 = mul nsw i32 %107, 12
  %109 = add nsw i32 %108, 4
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %106, i64 %110
  store i32 %105, ptr %111, align 4, !tbaa !9
  %112 = load i32, ptr %5, align 4, !tbaa !9
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  %114 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %113)
  %115 = add nsw i32 %112, %114
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = load i32, ptr %7, align 4, !tbaa !9
  %118 = mul nsw i32 %117, 12
  %119 = add nsw i32 %118, 5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %116, i64 %120
  store i32 %115, ptr %121, align 4, !tbaa !9
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %122)
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = load i32, ptr %7, align 4, !tbaa !9
  %126 = mul nsw i32 %125, 12
  %127 = add nsw i32 %126, 6
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i32, ptr %124, i64 %128
  store i32 %123, ptr %129, align 4, !tbaa !9
  %130 = load i32, ptr %5, align 4, !tbaa !9
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  %132 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %131)
  %133 = add nsw i32 %130, %132
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = load i32, ptr %7, align 4, !tbaa !9
  %136 = mul nsw i32 %135, 12
  %137 = add nsw i32 %136, 7
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i32, ptr %134, i64 %138
  store i32 %133, ptr %139, align 4, !tbaa !9
  %140 = load i32, ptr %5, align 4, !tbaa !9
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %141)
  %143 = add nsw i32 %140, %142
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = mul nsw i32 %145, 12
  %147 = add nsw i32 %146, 8
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %144, i64 %148
  store i32 %143, ptr %149, align 4, !tbaa !9
  %150 = load i32, ptr %5, align 4, !tbaa !9
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %151)
  %153 = add nsw i32 %150, %152
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = load i32, ptr %7, align 4, !tbaa !9
  %156 = mul nsw i32 %155, 12
  %157 = add nsw i32 %156, 9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds i32, ptr %154, i64 %158
  store i32 %153, ptr %159, align 4, !tbaa !9
  %160 = load i32, ptr %5, align 4, !tbaa !9
  %161 = load ptr, ptr %13, align 8, !tbaa !5
  %162 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %161)
  %163 = add nsw i32 %160, %162
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = load i32, ptr %7, align 4, !tbaa !9
  %166 = mul nsw i32 %165, 12
  %167 = add nsw i32 %166, 10
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds i32, ptr %164, i64 %168
  store i32 %163, ptr %169, align 4, !tbaa !9
  %170 = load i32, ptr %5, align 4, !tbaa !9
  %171 = load ptr, ptr %14, align 8, !tbaa !5
  %172 = call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %171)
  %173 = add nsw i32 %170, %172
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = load i32, ptr %7, align 4, !tbaa !9
  %176 = mul nsw i32 %175, 12
  %177 = add nsw i32 %176, 11
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds i32, ptr %174, i64 %178
  store i32 %173, ptr %179, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %180

180:                                              ; preds = %51
  %181 = load i32, ptr %7, align 4, !tbaa !9
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %7, align 4, !tbaa !9
  br label %46, !llvm.loop !11

183:                                              ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %184

184:                                              ; preds = %211, %183
  %185 = load i32, ptr %15, align 4, !tbaa !9
  %186 = load i32, ptr %4, align 4, !tbaa !9
  %187 = icmp slt i32 %185, %186
  br i1 %187, label %189, label %188

188:                                              ; preds = %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %214

189:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %190 = load i32, ptr %15, align 4, !tbaa !9
  %191 = call noundef ptr @_ZNK6R3Mesh4EdgeEi(ptr noundef nonnull align 8 dereferenceable(272) %33, i32 noundef %190)
  store ptr %191, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %192 = load ptr, ptr %16, align 8, !tbaa !5
  %193 = call noundef ptr @_ZNK6R3Mesh12VertexOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %192, i32 noundef 0)
  store ptr %193, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %194 = load ptr, ptr %16, align 8, !tbaa !5
  %195 = call noundef ptr @_ZNK6R3Mesh12VertexOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %194, i32 noundef 1)
  store ptr %195, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #8
  %196 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZNK6R3Mesh12EdgeMidpointEPK10R3MeshEdge(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %20, ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %196)
  %197 = load ptr, ptr %33, align 8, !tbaa !13
  %198 = getelementptr inbounds ptr, ptr %197, i64 4
  %199 = load ptr, ptr %198, align 8
  %200 = call noundef ptr %199(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #8
  store ptr %200, ptr %19, align 8, !tbaa !5
  %201 = load ptr, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #8
  %202 = load ptr, ptr %17, align 8, !tbaa !5
  %203 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6R3Mesh19VertexTextureCoordsEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %202)
  call void @_ZmldRK7R2Point(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %22, double noundef 5.000000e-01, ptr noundef nonnull align 8 dereferenceable(16) %203)
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #8
  %204 = load ptr, ptr %18, align 8, !tbaa !5
  %205 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6R3Mesh19VertexTextureCoordsEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %204)
  call void @_ZmldRK7R2Point(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %23, double noundef 5.000000e-01, ptr noundef nonnull align 8 dereferenceable(16) %205)
  call void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %23)
  call void @_ZN6R3Mesh22SetVertexTextureCoordsEP12R3MeshVertexRK7R2Point(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %201, ptr noundef nonnull align 8 dereferenceable(16) %21)
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #8
  %206 = load ptr, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #8
  %207 = load ptr, ptr %17, align 8, !tbaa !5
  %208 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %207)
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %25, double noundef 5.000000e-01, ptr noundef nonnull align 8 dereferenceable(24) %208)
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #8
  %209 = load ptr, ptr %18, align 8, !tbaa !5
  %210 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %209)
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %26, double noundef 5.000000e-01, ptr noundef nonnull align 8 dereferenceable(24) %210)
  call void @_ZplRK5RNRgbS1_(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %24, ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(24) %26)
  call void @_ZN6R3Mesh14SetVertexColorEP12R3MeshVertexRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %206, ptr noundef nonnull align 8 dereferenceable(24) %24)
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %211

211:                                              ; preds = %189
  %212 = load i32, ptr %15, align 4, !tbaa !9
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %15, align 4, !tbaa !9
  br label %184, !llvm.loop !15

214:                                              ; preds = %188
  br label %215

215:                                              ; preds = %218, %214
  %216 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %33)
  %217 = icmp sgt i32 %216, 0
  br i1 %217, label %218, label %223

218:                                              ; preds = %215
  %219 = call noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %33, i32 noundef 0)
  %220 = load ptr, ptr %33, align 8, !tbaa !13
  %221 = getelementptr inbounds ptr, ptr %220, i64 14
  %222 = load ptr, ptr %221, align 8
  call void %222(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %219)
  br label %215, !llvm.loop !16

223:                                              ; preds = %215
  br label %224

224:                                              ; preds = %227, %223
  %225 = call noundef i32 @_ZNK6R3Mesh6NEdgesEv(ptr noundef nonnull align 8 dereferenceable(272) %33)
  %226 = icmp sgt i32 %225, 0
  br i1 %226, label %227, label %232

227:                                              ; preds = %224
  %228 = call noundef ptr @_ZNK6R3Mesh4EdgeEi(ptr noundef nonnull align 8 dereferenceable(272) %33, i32 noundef 0)
  %229 = load ptr, ptr %33, align 8, !tbaa !13
  %230 = getelementptr inbounds ptr, ptr %229, i64 13
  %231 = load ptr, ptr %230, align 8
  call void %231(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %228)
  br label %224, !llvm.loop !17

232:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %233

233:                                              ; preds = %288, %232
  %234 = load i32, ptr %27, align 4, !tbaa !9
  %235 = load i32, ptr %3, align 4, !tbaa !9
  %236 = icmp slt i32 %234, %235
  br i1 %236, label %238, label %237

237:                                              ; preds = %233
  store i32 12, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %291

238:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %239

239:                                              ; preds = %284, %238
  %240 = load i32, ptr %29, align 4, !tbaa !9
  %241 = icmp slt i32 %240, 4
  br i1 %241, label %243, label %242

242:                                              ; preds = %239
  store i32 15, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %287

243:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %244 = load ptr, ptr %6, align 8, !tbaa !5
  %245 = load i32, ptr %27, align 4, !tbaa !9
  %246 = mul nsw i32 %245, 12
  %247 = load i32, ptr %29, align 4, !tbaa !9
  %248 = mul nsw i32 %247, 3
  %249 = add nsw i32 %246, %248
  %250 = add nsw i32 %249, 0
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds i32, ptr %244, i64 %251
  %253 = load i32, ptr %252, align 4, !tbaa !9
  %254 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %33, i32 noundef %253)
  store ptr %254, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %255 = load ptr, ptr %6, align 8, !tbaa !5
  %256 = load i32, ptr %27, align 4, !tbaa !9
  %257 = mul nsw i32 %256, 12
  %258 = load i32, ptr %29, align 4, !tbaa !9
  %259 = mul nsw i32 %258, 3
  %260 = add nsw i32 %257, %259
  %261 = add nsw i32 %260, 1
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds i32, ptr %255, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !9
  %265 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %33, i32 noundef %264)
  store ptr %265, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = load i32, ptr %27, align 4, !tbaa !9
  %268 = mul nsw i32 %267, 12
  %269 = load i32, ptr %29, align 4, !tbaa !9
  %270 = mul nsw i32 %269, 3
  %271 = add nsw i32 %268, %270
  %272 = add nsw i32 %271, 2
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds i32, ptr %266, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !9
  %276 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %33, i32 noundef %275)
  store ptr %276, ptr %32, align 8, !tbaa !5
  %277 = load ptr, ptr %30, align 8, !tbaa !5
  %278 = load ptr, ptr %31, align 8, !tbaa !5
  %279 = load ptr, ptr %32, align 8, !tbaa !5
  %280 = load ptr, ptr %33, align 8, !tbaa !13
  %281 = getelementptr inbounds ptr, ptr %280, i64 9
  %282 = load ptr, ptr %281, align 8
  %283 = call noundef ptr %282(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %277, ptr noundef %278, ptr noundef %279, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  br label %284

284:                                              ; preds = %243
  %285 = load i32, ptr %29, align 4, !tbaa !9
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %29, align 4, !tbaa !9
  br label %239, !llvm.loop !18

287:                                              ; preds = %242
  br label %288

288:                                              ; preds = %287
  %289 = load i32, ptr %27, align 4, !tbaa !9
  %290 = add nsw i32 %289, 1
  store i32 %290, ptr %27, align 4, !tbaa !9
  br label %233, !llvm.loop !19

291:                                              ; preds = %237
  %292 = load ptr, ptr %6, align 8, !tbaa !5
  %293 = icmp eq ptr %292, null
  br i1 %293, label %295, label %294

294:                                              ; preds = %291
  call void @_ZdaPv(ptr noundef %292) #10
  br label %295

295:                                              ; preds = %294, %291
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  ret void
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nobuiltin nounwind "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 = { "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 #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !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.R2Point = type { [2 x double] }
%class.RNRgb = type { [3 x double] }
%class.R3Point = type { [3 x double] }

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272), i32 noundef) local_unnamed_addr #0 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 #3 align 2

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #4

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

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

declare void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK7R2Point(ptr dead_on_unwind noalias writable sret(%class.R2Point) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh14SubdivideFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0) local_unnamed_addr #6 align 2 {
  %2 = alloca %class.R3Point, align 8
  %3 = alloca %class.R2Point, align 8
  %4 = alloca %class.R2Point, align 8
  %5 = alloca %class.R2Point, align 8
  %6 = alloca %class.RNRgb, align 8
  %7 = alloca %class.RNRgb, align 8
  %8 = alloca %class.RNRgb, align 8
  %9 = tail call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %10 = tail call noundef i32 @_ZNK6R3Mesh6NEdgesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %11 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %12 = mul nsw i32 %9, 12
  %13 = sext i32 %12 to i64
  %14 = icmp slt i32 %9, 0
  %15 = shl nsw i64 %13, 2
  %16 = select i1 %14, i64 -1, i64 %15
  %17 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %16) #7
  %18 = icmp sgt i32 %9, 0
  br i1 %18, label %.lr.ph.preheader, label %.preheader94

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = zext nneg i32 %9 to i64
  br label %.lr.ph

.preheader94:                                     ; preds = %.lr.ph, %1
  %19 = icmp sgt i32 %10, 0
  br i1 %19, label %.lr.ph97, label %.preheader93

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %20 = trunc nuw nsw i64 %indvars.iv to i32
  %21 = tail call noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %20)
  %22 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %21, i32 noundef 0)
  %23 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %21, i32 noundef 1)
  %24 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %21, i32 noundef 2)
  %25 = tail call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %21, i32 noundef 0)
  %26 = tail call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %21, i32 noundef 1)
  %27 = tail call noundef ptr @_ZNK6R3Mesh10EdgeOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %21, i32 noundef 2)
  %28 = tail call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %22)
  %29 = mul nuw nsw i64 %indvars.iv, 12
  %30 = getelementptr inbounds i32, ptr %17, i64 %29
  store i32 %28, ptr %30, align 4, !tbaa !5
  %31 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %25)
  %32 = add nsw i32 %31, %11
  %33 = or disjoint i64 %29, 1
  %34 = getelementptr inbounds i32, ptr %17, i64 %33
  store i32 %32, ptr %34, align 4, !tbaa !5
  %35 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %27)
  %36 = add nsw i32 %35, %11
  %37 = or disjoint i64 %29, 2
  %38 = getelementptr inbounds i32, ptr %17, i64 %37
  store i32 %36, ptr %38, align 4, !tbaa !5
  %39 = tail call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %23)
  %40 = or disjoint i64 %29, 3
  %41 = getelementptr inbounds i32, ptr %17, i64 %40
  store i32 %39, ptr %41, align 4, !tbaa !5
  %42 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %26)
  %43 = add nsw i32 %42, %11
  %44 = getelementptr inbounds i8, ptr %30, i64 16
  store i32 %43, ptr %44, align 4, !tbaa !5
  %45 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %25)
  %46 = add nsw i32 %45, %11
  %47 = getelementptr inbounds i8, ptr %30, i64 20
  store i32 %46, ptr %47, align 4, !tbaa !5
  %48 = tail call noundef i32 @_ZNK6R3Mesh8VertexIDEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %24)
  %49 = getelementptr inbounds i8, ptr %30, i64 24
  store i32 %48, ptr %49, align 4, !tbaa !5
  %50 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %27)
  %51 = add nsw i32 %50, %11
  %52 = getelementptr inbounds i8, ptr %30, i64 28
  store i32 %51, ptr %52, align 4, !tbaa !5
  %53 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %26)
  %54 = add nsw i32 %53, %11
  %55 = getelementptr inbounds i8, ptr %30, i64 32
  store i32 %54, ptr %55, align 4, !tbaa !5
  %56 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %25)
  %57 = add nsw i32 %56, %11
  %58 = getelementptr inbounds i8, ptr %30, i64 36
  store i32 %57, ptr %58, align 4, !tbaa !5
  %59 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %26)
  %60 = add nsw i32 %59, %11
  %61 = getelementptr inbounds i8, ptr %30, i64 40
  store i32 %60, ptr %61, align 4, !tbaa !5
  %62 = tail call noundef i32 @_ZNK6R3Mesh6EdgeIDEPK10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %27)
  %63 = add nsw i32 %62, %11
  %64 = getelementptr inbounds i8, ptr %30, i64 44
  store i32 %63, ptr %64, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader94, label %.lr.ph, !llvm.loop !9

.preheader93:                                     ; preds = %.lr.ph97, %.preheader94
  %65 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph98, label %.preheader92

.lr.ph97:                                         ; preds = %.preheader94, %.lr.ph97
  %.08796 = phi i32 [ %78, %.lr.ph97 ], [ 0, %.preheader94 ]
  %67 = call noundef ptr @_ZNK6R3Mesh4EdgeEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %.08796)
  %68 = call noundef ptr @_ZNK6R3Mesh12VertexOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %67, i32 noundef 0)
  %69 = call noundef ptr @_ZNK6R3Mesh12VertexOnEdgeEPK10R3MeshEdgei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %67, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #8
  call void @_ZNK6R3Mesh12EdgeMidpointEPK10R3MeshEdge(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %2, ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %67)
  %70 = load ptr, ptr %0, align 8, !tbaa !11
  %71 = getelementptr inbounds i8, ptr %70, i64 32
  %72 = load ptr, ptr %71, align 8
  %73 = call noundef ptr %72(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6R3Mesh19VertexTextureCoordsEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %68)
  call void @_ZmldRK7R2Point(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %4, double noundef 5.000000e-01, ptr noundef nonnull align 8 dereferenceable(16) %74)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6R3Mesh19VertexTextureCoordsEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %69)
  call void @_ZmldRK7R2Point(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %5, double noundef 5.000000e-01, ptr noundef nonnull align 8 dereferenceable(16) %75)
  call void @_ZplRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %3, ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @_ZN6R3Mesh22SetVertexTextureCoordsEP12R3MeshVertexRK7R2Point(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %73, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  %76 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %68)
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %7, double noundef 5.000000e-01, ptr noundef nonnull align 8 dereferenceable(24) %76)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #8
  %77 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh11VertexColorEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %69)
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %8, double noundef 5.000000e-01, ptr noundef nonnull align 8 dereferenceable(24) %77)
  call void @_ZplRK5RNRgbS1_(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @_ZN6R3Mesh14SetVertexColorEP12R3MeshVertexRK5RNRgb(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %73, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  %78 = add nuw nsw i32 %.08796, 1
  %exitcond103.not = icmp eq i32 %78, %10
  br i1 %exitcond103.not, label %.preheader93, label %.lr.ph97, !llvm.loop !13

.preheader92:                                     ; preds = %.lr.ph98, %.preheader93
  %79 = call noundef i32 @_ZNK6R3Mesh6NEdgesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph99, label %.preheader91

.lr.ph98:                                         ; preds = %.preheader93, %.lr.ph98
  %81 = call noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef 0)
  %82 = load ptr, ptr %0, align 8, !tbaa !11
  %83 = getelementptr inbounds i8, ptr %82, i64 112
  %84 = load ptr, ptr %83, align 8
  call void %84(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %81)
  %85 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %86 = icmp sgt i32 %85, 0
  br i1 %86, label %.lr.ph98, label %.preheader92, !llvm.loop !14

.preheader91:                                     ; preds = %.lr.ph99, %.preheader92
  br i1 %18, label %.preheader.preheader, label %._crit_edge

.preheader.preheader:                             ; preds = %.preheader91
  %wide.trip.count111 = zext nneg i32 %9 to i64
  br label %.preheader

.lr.ph99:                                         ; preds = %.preheader92, %.lr.ph99
  %87 = call noundef ptr @_ZNK6R3Mesh4EdgeEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef 0)
  %88 = load ptr, ptr %0, align 8, !tbaa !11
  %89 = getelementptr inbounds i8, ptr %88, i64 104
  %90 = load ptr, ptr %89, align 8
  call void %90(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %87)
  %91 = call noundef i32 @_ZNK6R3Mesh6NEdgesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %92 = icmp sgt i32 %91, 0
  br i1 %92, label %.lr.ph99, label %.preheader91, !llvm.loop !15

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv108 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next109, %.preheader ]
  %93 = mul nuw nsw i64 %indvars.iv108, 12
  %94 = getelementptr inbounds i32, ptr %17, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %95)
  %97 = getelementptr inbounds i8, ptr %94, i64 4
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %98)
  %100 = getelementptr inbounds i8, ptr %94, i64 8
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %101)
  %103 = load ptr, ptr %0, align 8, !tbaa !11
  %104 = getelementptr inbounds i8, ptr %103, i64 72
  %105 = load ptr, ptr %104, align 8
  %106 = call noundef ptr %105(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %96, ptr noundef %99, ptr noundef %102, ptr noundef null)
  %107 = or disjoint i64 %93, 3
  %108 = getelementptr inbounds i32, ptr %17, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %109)
  %111 = getelementptr inbounds i8, ptr %108, i64 4
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %112)
  %114 = getelementptr inbounds i8, ptr %108, i64 8
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %115)
  %117 = load ptr, ptr %0, align 8, !tbaa !11
  %118 = getelementptr inbounds i8, ptr %117, i64 72
  %119 = load ptr, ptr %118, align 8
  %120 = call noundef ptr %119(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %110, ptr noundef %113, ptr noundef %116, ptr noundef null)
  %121 = getelementptr inbounds i32, ptr %17, i64 %93
  %122 = getelementptr inbounds i8, ptr %121, i64 24
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %123)
  %125 = getelementptr inbounds i8, ptr %121, i64 28
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %126)
  %128 = getelementptr inbounds i8, ptr %121, i64 32
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %129)
  %131 = load ptr, ptr %0, align 8, !tbaa !11
  %132 = getelementptr inbounds i8, ptr %131, i64 72
  %133 = load ptr, ptr %132, align 8
  %134 = call noundef ptr %133(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %124, ptr noundef %127, ptr noundef %130, ptr noundef null)
  %135 = getelementptr inbounds i32, ptr %17, i64 %93
  %136 = getelementptr inbounds i8, ptr %135, i64 36
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %137)
  %139 = getelementptr inbounds i8, ptr %135, i64 40
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %140)
  %142 = getelementptr inbounds i8, ptr %135, i64 44
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %143)
  %145 = load ptr, ptr %0, align 8, !tbaa !11
  %146 = getelementptr inbounds i8, ptr %145, i64 72
  %147 = load ptr, ptr %146, align 8
  %148 = call noundef ptr %147(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %138, ptr noundef %141, ptr noundef %144, ptr noundef null)
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %exitcond112.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count111
  br i1 %exitcond112.not, label %._crit_edge, label %.preheader, !llvm.loop !16

._crit_edge:                                      ; preds = %.preheader, %.preheader91
  call void @_ZdaPv(ptr noundef nonnull %17) #9
  ret void
}

attributes #0 = { 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 #1 = { nobuiltin allocsize(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nobuiltin nounwind "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 = { "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 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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