; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes (ply)

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

%struct.PlyFile = type { ptr, i32, float, i32, ptr, i32, ptr, i32, ptr, ptr, ptr }
%struct.PlyElement = type { ptr, i32, i32, i32, ptr, ptr, i32, i32 }
%struct.PlyProperty = type { ptr, i32, i32, i32, i32, i32, i32, i32 }

@stderr = external global ptr, align 8
@.str.16 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [12 x i8], align 1

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @ply_header_complete(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.PlyFile, ptr %8, i32 0, i32 0
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %10, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef @.str.16) #5
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.PlyFile, ptr %13, i32 0, i32 1
  %15 = load i32, ptr %14, align 8, !tbaa !13
  switch i32 %15, label %25 [
    i32 1, label %16
    i32 2, label %19
    i32 3, label %22
  ]

16:                                               ; preds = %1
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.17) #5
  br label %31

19:                                               ; preds = %1
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef @.str.18) #5
  br label %31

22:                                               ; preds = %1
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.19) #5
  br label %31

25:                                               ; preds = %1
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.PlyFile, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.20, i32 noundef %29) #5
  call void @exit(i32 noundef -1) #6
  unreachable

31:                                               ; preds = %22, %19, %16
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %32

32:                                               ; preds = %48, %31
  %33 = load i32, ptr %3, align 4, !tbaa !14
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.PlyFile, ptr %34, i32 0, i32 5
  %36 = load i32, ptr %35, align 8, !tbaa !15
  %37 = icmp slt i32 %33, %36
  br i1 %37, label %38, label %51

38:                                               ; preds = %32
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.PlyFile, ptr %40, i32 0, i32 6
  %42 = load ptr, ptr %41, align 8, !tbaa !16
  %43 = load i32, ptr %3, align 4, !tbaa !14
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %42, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.21, ptr noundef %46) #5
  br label %48

48:                                               ; preds = %38
  %49 = load i32, ptr %3, align 4, !tbaa !14
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %3, align 4, !tbaa !14
  br label %32, !llvm.loop !17

51:                                               ; preds = %32
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %52

52:                                               ; preds = %68, %51
  %53 = load i32, ptr %3, align 4, !tbaa !14
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.PlyFile, ptr %54, i32 0, i32 7
  %56 = load i32, ptr %55, align 8, !tbaa !19
  %57 = icmp slt i32 %53, %56
  br i1 %57, label %58, label %71

58:                                               ; preds = %52
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.PlyFile, ptr %60, i32 0, i32 8
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = load i32, ptr %3, align 4, !tbaa !14
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %62, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.22, ptr noundef %66) #5
  br label %68

68:                                               ; preds = %58
  %69 = load i32, ptr %3, align 4, !tbaa !14
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %3, align 4, !tbaa !14
  br label %52, !llvm.loop !21

71:                                               ; preds = %52
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %72

72:                                               ; preds = %147, %71
  %73 = load i32, ptr %3, align 4, !tbaa !14
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.PlyFile, ptr %74, i32 0, i32 3
  %76 = load i32, ptr %75, align 8, !tbaa !22
  %77 = icmp slt i32 %73, %76
  br i1 %77, label %78, label %150

78:                                               ; preds = %72
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.PlyFile, ptr %79, i32 0, i32 4
  %81 = load ptr, ptr %80, align 8, !tbaa !23
  %82 = load i32, ptr %3, align 4, !tbaa !14
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  store ptr %85, ptr %6, align 8, !tbaa !5
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.PlyElement, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !24
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.PlyElement, ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 8, !tbaa !26
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str.23, ptr noundef %89, i32 noundef %92) #5
  store i32 0, ptr %4, align 4, !tbaa !14
  br label %94

94:                                               ; preds = %143, %78
  %95 = load i32, ptr %4, align 4, !tbaa !14
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.PlyElement, ptr %96, i32 0, i32 3
  %98 = load i32, ptr %97, align 8, !tbaa !27
  %99 = icmp slt i32 %95, %98
  br i1 %99, label %100, label %146

100:                                              ; preds = %94
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.PlyElement, ptr %101, i32 0, i32 4
  %103 = load ptr, ptr %102, align 8, !tbaa !28
  %104 = load i32, ptr %4, align 4, !tbaa !14
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %103, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  store ptr %107, ptr %7, align 8, !tbaa !5
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.PlyProperty, ptr %108, i32 0, i32 4
  %110 = load i32, ptr %109, align 4, !tbaa !29
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %130

112:                                              ; preds = %100
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str.24) #5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.PlyProperty, ptr %116, i32 0, i32 5
  %118 = load i32, ptr %117, align 8, !tbaa !31
  call void @_Z17write_scalar_typeP8_IO_FILEi(ptr noundef %115, i32 noundef %118)
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str.25) #5
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.PlyProperty, ptr %122, i32 0, i32 1
  %124 = load i32, ptr %123, align 8, !tbaa !32
  call void @_Z17write_scalar_typeP8_IO_FILEi(ptr noundef %121, i32 noundef %124)
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.PlyProperty, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !33
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.26, ptr noundef %128) #5
  br label %142

130:                                              ; preds = %100
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef @.str.27) #5
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.PlyProperty, ptr %134, i32 0, i32 1
  %136 = load i32, ptr %135, align 8, !tbaa !32
  call void @_Z17write_scalar_typeP8_IO_FILEi(ptr noundef %133, i32 noundef %136)
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.PlyProperty, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !33
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef @.str.26, ptr noundef %140) #5
  br label %142

142:                                              ; preds = %130, %112
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %4, align 4, !tbaa !14
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %4, align 4, !tbaa !14
  br label %94, !llvm.loop !34

146:                                              ; preds = %94
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %3, align 4, !tbaa !14
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %3, align 4, !tbaa !14
  br label %72, !llvm.loop !35

150:                                              ; preds = %72
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str.28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z17write_scalar_typeP8_IO_FILEi(ptr noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn 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 = { 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 #4 = { 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 = { nounwind }
attributes #6 = { noreturn 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 0}
!10 = !{!"_ZTS7PlyFile", !6, i64 0, !11, i64 8, !12, i64 12, !11, i64 16, !6, i64 24, !11, i64 32, !6, i64 40, !11, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !11, i64 8}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 32}
!16 = !{!10, !6, i64 40}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !11, i64 48}
!20 = !{!10, !6, i64 56}
!21 = distinct !{!21, !18}
!22 = !{!10, !11, i64 16}
!23 = !{!10, !6, i64 24}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTS10PlyElement", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44}
!26 = !{!25, !11, i64 8}
!27 = !{!25, !11, i64 16}
!28 = !{!25, !6, i64 24}
!29 = !{!30, !11, i64 20}
!30 = !{!"_ZTS11PlyProperty", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!31 = !{!30, !11, i64 24}
!32 = !{!30, !11, i64 8}
!33 = !{!30, !6, i64 0}
!34 = distinct !{!34, !18}
!35 = distinct !{!35, !18}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.16 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [12 x i8], align 1
@switch.table.ply_header_complete = private unnamed_addr constant [3 x ptr] [ptr @.str.17, ptr @.str.18, ptr @.str.19], align 8

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @ply_header_complete(ptr nocapture noundef readonly %0) local_unnamed_addr #2 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %3 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.16) #3
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !12
  %switch.tableidx = add i32 %5, -1
  %6 = icmp ult i32 %switch.tableidx, 3
  br i1 %6, label %switch.lookup, label %7

7:                                                ; preds = %1
  %8 = load ptr, ptr @stderr, align 8, !tbaa !13
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.20, i32 noundef %5) #4
  tail call void @exit(i32 noundef -1) #5
  unreachable

switch.lookup:                                    ; preds = %1
  %10 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [3 x ptr], ptr @switch.table.ply_header_complete, i64 0, i64 %10
  %switch.load = load ptr, ptr %switch.gep, align 8
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull %switch.load) #3
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load i32, ptr %12, align 8, !tbaa !14
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %.preheader47

.lr.ph:                                           ; preds = %switch.lookup
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  br label %20

.preheader47:                                     ; preds = %20, %switch.lookup
  %16 = getelementptr inbounds i8, ptr %0, i64 48
  %17 = load i32, ptr %16, align 8, !tbaa !15
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph50, label %.preheader

.lr.ph50:                                         ; preds = %.preheader47
  %19 = getelementptr inbounds i8, ptr %0, i64 56
  br label %32

20:                                               ; preds = %.lr.ph, %20
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %20 ]
  %21 = load ptr, ptr %15, align 8, !tbaa !16
  %22 = getelementptr inbounds ptr, ptr %21, i64 %indvars.iv
  %23 = load ptr, ptr %22, align 8, !tbaa !13
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.21, ptr noundef %23) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr %12, align 8, !tbaa !14
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next, %26
  br i1 %27, label %20, label %.preheader47, !llvm.loop !17

.preheader:                                       ; preds = %32, %.preheader47
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = load i32, ptr %28, align 8, !tbaa !19
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph54, label %._crit_edge55

.lr.ph54:                                         ; preds = %.preheader
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  br label %40

32:                                               ; preds = %.lr.ph50, %32
  %indvars.iv57 = phi i64 [ 0, %.lr.ph50 ], [ %indvars.iv.next58, %32 ]
  %33 = load ptr, ptr %19, align 8, !tbaa !20
  %34 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv57
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.22, ptr noundef %35) #3
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %37 = load i32, ptr %16, align 8, !tbaa !15
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next58, %38
  br i1 %39, label %32, label %.preheader, !llvm.loop !21

40:                                               ; preds = %.lr.ph54, %._crit_edge
  %indvars.iv63 = phi i64 [ 0, %.lr.ph54 ], [ %indvars.iv.next64, %._crit_edge ]
  %41 = load ptr, ptr %31, align 8, !tbaa !22
  %42 = getelementptr inbounds ptr, ptr %41, i64 %indvars.iv63
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = load ptr, ptr %43, align 8, !tbaa !23
  %45 = getelementptr inbounds i8, ptr %43, i64 8
  %46 = load i32, ptr %45, align 8, !tbaa !25
  %47 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.23, ptr noundef %44, i32 noundef %46) #3
  %48 = getelementptr inbounds i8, ptr %43, i64 16
  %49 = load i32, ptr %48, align 8, !tbaa !26
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph52, label %._crit_edge

.lr.ph52:                                         ; preds = %40
  %51 = getelementptr inbounds i8, ptr %43, i64 24
  br label %52

52:                                               ; preds = %.lr.ph52, %62
  %indvars.iv60 = phi i64 [ 0, %.lr.ph52 ], [ %indvars.iv.next61, %62 ]
  %53 = load ptr, ptr %51, align 8, !tbaa !27
  %54 = getelementptr inbounds ptr, ptr %53, i64 %indvars.iv60
  %55 = load ptr, ptr %54, align 8, !tbaa !13
  %56 = getelementptr inbounds i8, ptr %55, i64 20
  %57 = load i32, ptr %56, align 4, !tbaa !28
  %.not = icmp eq i32 %57, 0
  br i1 %.not, label %62, label %58

58:                                               ; preds = %52
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.24) #3
  %60 = getelementptr inbounds i8, ptr %55, i64 24
  %61 = load i32, ptr %60, align 8, !tbaa !30
  tail call void @_Z17write_scalar_typeP8_IO_FILEi(ptr noundef %2, i32 noundef %61)
  br label %62

62:                                               ; preds = %52, %58
  %.str.25.sink = phi ptr [ @.str.25, %58 ], [ @.str.27, %52 ]
  %63 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull %.str.25.sink) #3
  %64 = getelementptr inbounds i8, ptr %55, i64 8
  %65 = load i32, ptr %64, align 8, !tbaa !31
  tail call void @_Z17write_scalar_typeP8_IO_FILEi(ptr noundef %2, i32 noundef %65)
  %66 = load ptr, ptr %55, align 8, !tbaa !32
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.26, ptr noundef %66) #3
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %68 = load i32, ptr %48, align 8, !tbaa !26
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next61, %69
  br i1 %70, label %52, label %._crit_edge, !llvm.loop !33

._crit_edge:                                      ; preds = %62, %40
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %71 = load i32, ptr %28, align 8, !tbaa !19
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next64, %72
  br i1 %73, label %40, label %._crit_edge55, !llvm.loop !34

._crit_edge55:                                    ; preds = %._crit_edge, %.preheader
  %74 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.28) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z17write_scalar_typeP8_IO_FILEi(ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { noreturn 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 #2 = { 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 }
attributes #4 = { cold nounwind }
attributes #5 = { noreturn 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, !7, i64 0}
!6 = !{!"_ZTS7PlyFile", !7, i64 0, !10, i64 8, !11, i64 12, !10, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !7, i64 56, !7, i64 64, !7, i64 72}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !10, i64 32}
!15 = !{!6, !10, i64 48}
!16 = !{!6, !7, i64 40}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!6, !10, i64 16}
!20 = !{!6, !7, i64 56}
!21 = distinct !{!21, !18}
!22 = !{!6, !7, i64 24}
!23 = !{!24, !7, i64 0}
!24 = !{!"_ZTS10PlyElement", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44}
!25 = !{!24, !10, i64 8}
!26 = !{!24, !10, i64 16}
!27 = !{!24, !7, i64 24}
!28 = !{!29, !10, i64 20}
!29 = !{!"_ZTS11PlyProperty", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!30 = !{!29, !10, i64 24}
!31 = !{!29, !10, i64 8}
!32 = !{!29, !7, i64 0}
!33 = distinct !{!33, !18}
!34 = distinct !{!34, !18}


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