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

; 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.R3MeshVertex = type { ptr, %class.RNArray.0, %class.R3Point, %class.R3Vector, %class.R2Point, %class.RNRgb, double, i32, %class.RNFlags, double, i32, ptr }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.RNRgb = type { [3 x double] }
%class.RNFlags = type { i64 }

@.str.58 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.161 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.162 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [29 x i8], align 1

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare void @_Z6RNFailPKcz(ptr noundef, ...) #4

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare i32 @fclose(ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK6R3Mesh12WriteRayFileEPKc(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1) unnamed_addr #5 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noalias ptr @fopen(ptr noundef %19, ptr noundef @.str.161)
  store ptr %20, ptr %6, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %24, label %22

22:                                               ; preds = %2
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.58, ptr noundef %23)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %89

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %51, %24
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %18)
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %54

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %18, i32 noundef %31)
  store ptr %32, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %18, ptr noundef %33)
  store ptr %34, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %18, ptr noundef %35)
  store ptr %36, ptr %11, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %40)
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %42)
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = call noundef double @_ZNK8R3Vector1XEv(ptr noundef nonnull align 8 dereferenceable(24) %44)
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = call noundef double @_ZNK8R3Vector1YEv(ptr noundef nonnull align 8 dereferenceable(24) %46)
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = call noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %48)
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.162, double noundef %39, double noundef %41, double noundef %43, double noundef %45, double noundef %47, double noundef %49) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %51

51:                                               ; preds = %30
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %8, align 4, !tbaa !9
  br label %25, !llvm.loop !11

54:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %83, %54
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %18)
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

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

60:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = call noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %18, i32 noundef %61)
  store ptr %62, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %18, ptr noundef %63, i32 noundef 0)
  store ptr %64, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %18, ptr noundef %65, i32 noundef 1)
  store ptr %66, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %18, ptr noundef %67, i32 noundef 2)
  store ptr %68, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = call noundef i32 @_ZNK6R3Mesh12FaceMaterialEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %18, ptr noundef %69)
  store i32 %70, ptr %17, align 4, !tbaa !9
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = load i32, ptr %17, align 4, !tbaa !9
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = getelementptr inbounds %class.R3MeshVertex, ptr %73, i32 0, i32 7
  %75 = load i32, ptr %74, align 8, !tbaa !13
  %76 = load ptr, ptr %15, align 8, !tbaa !5
  %77 = getelementptr inbounds %class.R3MeshVertex, ptr %76, i32 0, i32 7
  %78 = load i32, ptr %77, align 8, !tbaa !13
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  %80 = getelementptr inbounds %class.R3MeshVertex, ptr %79, i32 0, i32 7
  %81 = load i32, ptr %80, align 8, !tbaa !13
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str.163, i32 noundef %72, i32 noundef %75, i32 noundef %78, i32 noundef %81) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %83

83:                                               ; preds = %60
  %84 = load i32, ptr %12, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %12, align 4, !tbaa !9
  br label %55, !llvm.loop !24

86:                                               ; preds = %59
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = call i32 @fclose(ptr noundef %87)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %89

89:                                               ; preds = %86, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %90 = load i32, ptr %3, align 4
  ret i32 %90
}

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 120}
!14 = !{!"_ZTS12R3MeshVertex", !15, i64 8, !17, i64 24, !18, i64 48, !19, i64 72, !20, i64 88, !21, i64 112, !10, i64 120, !22, i64 128, !21, i64 136, !10, i64 144, !6, i64 152}
!15 = !{!"_ZTS7RNArrayIP10R3MeshEdgeE", !16, i64 0}
!16 = !{!"_ZTS8RNVArray", !6, i64 0, !10, i64 8, !10, i64 12}
!17 = !{!"_ZTS7R3Point", !7, i64 0}
!18 = !{!"_ZTS8R3Vector", !7, i64 0}
!19 = !{!"_ZTS7R2Point", !7, i64 0}
!20 = !{!"_ZTS5RNRgb", !7, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = !{!"_ZTS7RNFlags", !23, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = distinct !{!24, !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"

@.str.58 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.161 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.162 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [29 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh12FaceMaterialEPK10R3MeshFace(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 double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

declare void @_Z6RNFailPKcz(ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZNK6R3Mesh12WriteRayFileEPKc(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1) unnamed_addr #4 align 2 {
  %3 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.161)
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %6, label %.preheader31

.preheader31:                                     ; preds = %2
  %4 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %.preheader

6:                                                ; preds = %2
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.58, ptr noundef %1)
  br label %38

.preheader:                                       ; preds = %.lr.ph, %.preheader31
  %7 = tail call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph34, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader31, %.lr.ph
  %.02832 = phi i32 [ %19, %.lr.ph ], [ 0, %.preheader31 ]
  %9 = tail call noundef ptr @_ZNK6R3Mesh6VertexEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %.02832)
  %10 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %9)
  %11 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh12VertexNormalEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %9)
  %12 = tail call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %13 = tail call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %14 = tail call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %15 = tail call noundef double @_ZNK8R3Vector1XEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %16 = tail call noundef double @_ZNK8R3Vector1YEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %17 = tail call noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.162, double noundef %12, double noundef %13, double noundef %14, double noundef %15, double noundef %16, double noundef %17) #5
  %19 = add nuw nsw i32 %.02832, 1
  %20 = tail call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph, label %.preheader, !llvm.loop !5

._crit_edge:                                      ; preds = %.lr.ph34, %.preheader
  %22 = tail call i32 @fclose(ptr noundef nonnull %3)
  br label %38

.lr.ph34:                                         ; preds = %.preheader, %.lr.ph34
  %.02933 = phi i32 [ %35, %.lr.ph34 ], [ 0, %.preheader ]
  %23 = tail call noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %0, i32 noundef %.02933)
  %24 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %23, i32 noundef 0)
  %25 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %23, i32 noundef 1)
  %26 = tail call noundef ptr @_ZNK6R3Mesh12VertexOnFaceEPK10R3MeshFacei(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %23, i32 noundef 2)
  %27 = tail call noundef i32 @_ZNK6R3Mesh12FaceMaterialEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %23)
  %28 = getelementptr inbounds i8, ptr %24, i64 120
  %29 = load i32, ptr %28, align 8, !tbaa !7
  %30 = getelementptr inbounds i8, ptr %25, i64 120
  %31 = load i32, ptr %30, align 8, !tbaa !7
  %32 = getelementptr inbounds i8, ptr %26, i64 120
  %33 = load i32, ptr %32, align 8, !tbaa !7
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.163, i32 noundef %27, i32 noundef %29, i32 noundef %31, i32 noundef %33) #5
  %35 = add nuw nsw i32 %.02933, 1
  %36 = tail call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %.lr.ph34, label %._crit_edge, !llvm.loop !22

38:                                               ; preds = %._crit_edge, %6
  %.0 = phi i32 [ 1, %._crit_edge ], [ 0, %6 ]
  ret i32 %.0
}

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

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

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

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 = { 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 #2 = { nofree 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !14, i64 120}
!8 = !{!"_ZTS12R3MeshVertex", !9, i64 8, !15, i64 24, !16, i64 48, !17, i64 72, !18, i64 88, !19, i64 112, !14, i64 120, !20, i64 128, !19, i64 136, !14, i64 144, !11, i64 152}
!9 = !{!"_ZTS7RNArrayIP10R3MeshEdgeE", !10, i64 0}
!10 = !{!"_ZTS8RNVArray", !11, i64 0, !14, i64 8, !14, i64 12}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"int", !12, i64 0}
!15 = !{!"_ZTS7R3Point", !12, i64 0}
!16 = !{!"_ZTS8R3Vector", !12, i64 0}
!17 = !{!"_ZTS7R2Point", !12, i64 0}
!18 = !{!"_ZTS5RNRgb", !12, i64 0}
!19 = !{!"double", !12, i64 0}
!20 = !{!"_ZTS7RNFlags", !21, i64 0}
!21 = !{!"long", !12, i64 0}
!22 = distinct !{!22, !6}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass