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

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

@ply_type_size = external dso_local global [9 x i32], align 16
@.str.9 = external hidden unnamed_addr constant [85 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z8my_allociiPc(i32 noundef, i32 noundef, ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18binary_get_elementP7PlyFilePc(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.PlyFile, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  store ptr %25, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.PlyFile, ptr %26, i32 0, i32 9
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  store ptr %28, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.PlyElement, ptr %29, i32 0, i32 6
  %31 = load i32, ptr %30, align 8, !tbaa !14
  %32 = icmp ne i32 %31, -1
  br i1 %32, label %33, label %46

33:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  store i32 1, ptr %21, align 4, !tbaa !16
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.PlyElement, ptr %34, i32 0, i32 7
  %36 = load i32, ptr %35, align 4, !tbaa !17
  %37 = call noundef ptr @_Z8my_allociiPc(i32 noundef %36, i32 noundef 1662, ptr noundef @.str.9)
  store ptr %37, ptr %20, align 8, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.PlyElement, ptr %39, i32 0, i32 6
  %41 = load i32, ptr %40, align 8, !tbaa !14
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %38, i64 %42
  store ptr %43, ptr %22, align 8, !tbaa !5
  %44 = load ptr, ptr %20, align 8, !tbaa !5
  %45 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %44, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  br label %47

46:                                               ; preds = %2
  store i32 0, ptr %21, align 4, !tbaa !16
  br label %47

47:                                               ; preds = %46, %33
  store i32 0, ptr %5, align 4, !tbaa !16
  br label %48

48:                                               ; preds = %209, %47
  %49 = load i32, ptr %5, align 4, !tbaa !16
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.PlyElement, ptr %50, i32 0, i32 3
  %52 = load i32, ptr %51, align 8, !tbaa !18
  %53 = icmp slt i32 %49, %52
  br i1 %53, label %54, label %212

54:                                               ; preds = %48
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.PlyElement, ptr %55, i32 0, i32 4
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = load i32, ptr %5, align 4, !tbaa !16
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %57, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  store ptr %61, ptr %8, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.PlyElement, ptr %62, i32 0, i32 5
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  %65 = load i32, ptr %5, align 4, !tbaa !16
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %64, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !21
  %69 = sext i8 %68 to i32
  %70 = load i32, ptr %21, align 4, !tbaa !16
  %71 = or i32 %69, %70
  store i32 %71, ptr %18, align 4, !tbaa !16
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.PlyElement, ptr %72, i32 0, i32 5
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = load i32, ptr %5, align 4, !tbaa !16
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i8, ptr %74, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !21
  %79 = icmp ne i8 %78, 0
  br i1 %79, label %80, label %82

80:                                               ; preds = %54
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %81, ptr %10, align 8, !tbaa !5
  br label %84

82:                                               ; preds = %54
  %83 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %83, ptr %10, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %82, %80
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.PlyProperty, ptr %85, i32 0, i32 4
  %87 = load i32, ptr %86, align 4, !tbaa !22
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %183

89:                                               ; preds = %84
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.PlyFile, ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 8, !tbaa !24
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.PlyProperty, ptr %94, i32 0, i32 5
  %96 = load i32, ptr %95, align 8, !tbaa !25
  call void @_Z15get_binary_itemP8_IO_FILEiiPiPjPd(ptr noundef %90, i32 noundef %93, i32 noundef %96, ptr noundef %14, ptr noundef %15, ptr noundef %16)
  %97 = load i32, ptr %18, align 4, !tbaa !16
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %113

99:                                               ; preds = %89
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.PlyProperty, ptr %101, i32 0, i32 7
  %103 = load i32, ptr %102, align 8, !tbaa !26
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i8, ptr %100, i64 %104
  store ptr %105, ptr %11, align 8, !tbaa !5
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.PlyProperty, ptr %107, i32 0, i32 6
  %109 = load i32, ptr %108, align 4, !tbaa !27
  %110 = load i32, ptr %14, align 4, !tbaa !16
  %111 = load i32, ptr %15, align 4, !tbaa !16
  %112 = load double, ptr %16, align 8, !tbaa !28
  call void @_Z10store_itemPciijd(ptr noundef %106, i32 noundef %109, i32 noundef %110, i32 noundef %111, double noundef %112)
  br label %113

113:                                              ; preds = %99, %89
  %114 = load i32, ptr %14, align 4, !tbaa !16
  store i32 %114, ptr %17, align 4, !tbaa !16
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.PlyProperty, ptr %115, i32 0, i32 2
  %117 = load i32, ptr %116, align 4, !tbaa !30
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [9 x i32], ptr @ply_type_size, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !16
  store i32 %120, ptr %13, align 4, !tbaa !16
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.PlyProperty, ptr %122, i32 0, i32 3
  %124 = load i32, ptr %123, align 8, !tbaa !31
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i8, ptr %121, i64 %125
  store ptr %126, ptr %19, align 8, !tbaa !5
  %127 = load i32, ptr %17, align 4, !tbaa !16
  %128 = icmp eq i32 %127, 0
  br i1 %128, label %129, label %135

129:                                              ; preds = %113
  %130 = load i32, ptr %18, align 4, !tbaa !16
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr null, ptr %133, align 8, !tbaa !5
  br label %134

134:                                              ; preds = %132, %129
  br label %182

135:                                              ; preds = %113
  %136 = load i32, ptr %18, align 4, !tbaa !16
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %150

138:                                              ; preds = %135
  %139 = load i32, ptr %13, align 4, !tbaa !16
  %140 = sext i32 %139 to i64
  %141 = mul i64 1, %140
  %142 = load i32, ptr %17, align 4, !tbaa !16
  %143 = sext i32 %142 to i64
  %144 = mul i64 %141, %143
  %145 = trunc i64 %144 to i32
  %146 = call noundef ptr @_Z8my_allociiPc(i32 noundef %145, i32 noundef 1703, ptr noundef @.str.9)
  store ptr %146, ptr %12, align 8, !tbaa !5
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %147, ptr %11, align 8, !tbaa !5
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %148, ptr %149, align 8, !tbaa !5
  br label %150

150:                                              ; preds = %138, %135
  store i32 0, ptr %6, align 4, !tbaa !16
  br label %151

151:                                              ; preds = %178, %150
  %152 = load i32, ptr %6, align 4, !tbaa !16
  %153 = load i32, ptr %17, align 4, !tbaa !16
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %155, label %181

155:                                              ; preds = %151
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.PlyFile, ptr %157, i32 0, i32 1
  %159 = load i32, ptr %158, align 8, !tbaa !24
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.PlyProperty, ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 8, !tbaa !32
  call void @_Z15get_binary_itemP8_IO_FILEiiPiPjPd(ptr noundef %156, i32 noundef %159, i32 noundef %162, ptr noundef %14, ptr noundef %15, ptr noundef %16)
  %163 = load i32, ptr %18, align 4, !tbaa !16
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %177

165:                                              ; preds = %155
  %166 = load ptr, ptr %11, align 8, !tbaa !5
  %167 = load ptr, ptr %8, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.PlyProperty, ptr %167, i32 0, i32 2
  %169 = load i32, ptr %168, align 4, !tbaa !30
  %170 = load i32, ptr %14, align 4, !tbaa !16
  %171 = load i32, ptr %15, align 4, !tbaa !16
  %172 = load double, ptr %16, align 8, !tbaa !28
  call void @_Z10store_itemPciijd(ptr noundef %166, i32 noundef %169, i32 noundef %170, i32 noundef %171, double noundef %172)
  %173 = load i32, ptr %13, align 4, !tbaa !16
  %174 = load ptr, ptr %11, align 8, !tbaa !5
  %175 = sext i32 %173 to i64
  %176 = getelementptr inbounds i8, ptr %174, i64 %175
  store ptr %176, ptr %11, align 8, !tbaa !5
  br label %177

177:                                              ; preds = %165, %155
  br label %178

178:                                              ; preds = %177
  %179 = load i32, ptr %6, align 4, !tbaa !16
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %6, align 4, !tbaa !16
  br label %151, !llvm.loop !33

181:                                              ; preds = %151
  br label %182

182:                                              ; preds = %181, %134
  br label %208

183:                                              ; preds = %84
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.PlyFile, ptr %185, i32 0, i32 1
  %187 = load i32, ptr %186, align 8, !tbaa !24
  %188 = load ptr, ptr %8, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.PlyProperty, ptr %188, i32 0, i32 1
  %190 = load i32, ptr %189, align 8, !tbaa !32
  call void @_Z15get_binary_itemP8_IO_FILEiiPiPjPd(ptr noundef %184, i32 noundef %187, i32 noundef %190, ptr noundef %14, ptr noundef %15, ptr noundef %16)
  %191 = load i32, ptr %18, align 4, !tbaa !16
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %207

193:                                              ; preds = %183
  %194 = load ptr, ptr %10, align 8, !tbaa !5
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.PlyProperty, ptr %195, i32 0, i32 3
  %197 = load i32, ptr %196, align 8, !tbaa !31
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds i8, ptr %194, i64 %198
  store ptr %199, ptr %11, align 8, !tbaa !5
  %200 = load ptr, ptr %11, align 8, !tbaa !5
  %201 = load ptr, ptr %8, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.PlyProperty, ptr %201, i32 0, i32 2
  %203 = load i32, ptr %202, align 4, !tbaa !30
  %204 = load i32, ptr %14, align 4, !tbaa !16
  %205 = load i32, ptr %15, align 4, !tbaa !16
  %206 = load double, ptr %16, align 8, !tbaa !28
  call void @_Z10store_itemPciijd(ptr noundef %200, i32 noundef %203, i32 noundef %204, i32 noundef %205, double noundef %206)
  br label %207

207:                                              ; preds = %193, %183
  br label %208

208:                                              ; preds = %207, %182
  br label %209

209:                                              ; preds = %208
  %210 = load i32, ptr %5, align 4, !tbaa !16
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %5, align 4, !tbaa !16
  br label %48, !llvm.loop !35

212:                                              ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z10store_itemPciijd(ptr noundef, i32 noundef, i32 noundef, i32 noundef, double noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !6, i64 64}
!14 = !{!15, !11, i64 40}
!15 = !{!"_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}
!16 = !{!11, !11, i64 0}
!17 = !{!15, !11, i64 44}
!18 = !{!15, !11, i64 16}
!19 = !{!15, !6, i64 24}
!20 = !{!15, !6, i64 32}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !11, i64 20}
!23 = !{!"_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}
!24 = !{!10, !11, i64 8}
!25 = !{!23, !11, i64 24}
!26 = !{!23, !11, i64 32}
!27 = !{!23, !11, i64 28}
!28 = !{!29, !29, i64 0}
!29 = !{!"double", !7, i64 0}
!30 = !{!23, !11, i64 12}
!31 = !{!23, !11, i64 16}
!32 = !{!23, !11, i64 8}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


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

@ply_type_size = external dso_local local_unnamed_addr global [9 x i32], align 16
@.str.9 = external hidden unnamed_addr constant [85 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z8my_allociiPc(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18binary_get_elementP7PlyFilePc(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = load ptr, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %8, i64 40
  %10 = load i32, ptr %9, align 8, !tbaa !13
  %.not = icmp eq i32 %10, -1
  br i1 %.not, label %18, label %11

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %8, i64 44
  %13 = load i32, ptr %12, align 4, !tbaa !15
  %14 = tail call noundef ptr @_Z8my_allociiPc(i32 noundef %13, i32 noundef 1662, ptr noundef nonnull @.str.9)
  %15 = load i32, ptr %9, align 8, !tbaa !13
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i8, ptr %1, i64 %16
  store ptr %14, ptr %17, align 8, !tbaa !16
  br label %18

18:                                               ; preds = %2, %11
  %.060 = phi ptr [ %14, %11 ], [ null, %2 ]
  %.059 = phi i32 [ 1, %11 ], [ 0, %2 ]
  %19 = getelementptr inbounds i8, ptr %8, i64 16
  %20 = load i32, ptr %19, align 8, !tbaa !17
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph81, label %._crit_edge

.lr.ph81:                                         ; preds = %18
  %22 = getelementptr inbounds i8, ptr %8, i64 24
  %23 = getelementptr inbounds i8, ptr %8, i64 32
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  br label %25

25:                                               ; preds = %.lr.ph81, %.loopexit
  %indvars.iv = phi i64 [ 0, %.lr.ph81 ], [ %indvars.iv.next, %.loopexit ]
  %26 = load ptr, ptr %22, align 8, !tbaa !18
  %27 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = load ptr, ptr %23, align 8, !tbaa !19
  %30 = getelementptr inbounds i8, ptr %29, i64 %indvars.iv
  %31 = load i8, ptr %30, align 1, !tbaa !20
  %32 = sext i8 %31 to i32
  %33 = or i32 %.059, %32
  %.not65 = icmp eq i8 %31, 0
  %.060. = select i1 %.not65, ptr %.060, ptr %1
  %34 = getelementptr inbounds i8, ptr %28, i64 20
  %35 = load i32, ptr %34, align 4, !tbaa !21
  %.not66 = icmp eq i32 %35, 0
  %36 = load i32, ptr %24, align 8, !tbaa !23
  %.not67 = icmp eq i32 %33, 0
  br i1 %.not66, label %81, label %37

37:                                               ; preds = %25
  %38 = getelementptr inbounds i8, ptr %28, i64 24
  %39 = load i32, ptr %38, align 8, !tbaa !24
  call void @_Z15get_binary_itemP8_IO_FILEiiPiPjPd(ptr noundef %6, i32 noundef %36, i32 noundef %39, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  br i1 %.not67, label %40, label %.thread

40:                                               ; preds = %37
  %41 = load i32, ptr %3, align 4, !tbaa !25
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph.split.us.preheader, label %.loopexit

.thread:                                          ; preds = %37
  %43 = getelementptr inbounds i8, ptr %28, i64 32
  %44 = load i32, ptr %43, align 8, !tbaa !26
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr %.060., i64 %45
  %47 = getelementptr inbounds i8, ptr %28, i64 28
  %48 = load i32, ptr %47, align 4, !tbaa !27
  %49 = load i32, ptr %3, align 4, !tbaa !25
  %50 = load i32, ptr %4, align 4, !tbaa !25
  %51 = load double, ptr %5, align 8, !tbaa !28
  call void @_Z10store_itemPciijd(ptr noundef %46, i32 noundef %48, i32 noundef %49, i32 noundef %50, double noundef %51)
  %52 = load i32, ptr %3, align 4, !tbaa !25
  %53 = getelementptr inbounds i8, ptr %28, i64 16
  %54 = load i32, ptr %53, align 8, !tbaa !30
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i8, ptr %.060., i64 %55
  %57 = icmp eq i32 %52, 0
  br i1 %57, label %58, label %.thread85

58:                                               ; preds = %.thread
  store ptr null, ptr %56, align 8, !tbaa !16
  br label %.loopexit

.thread85:                                        ; preds = %.thread
  %59 = getelementptr inbounds i8, ptr %28, i64 12
  %60 = load i32, ptr %59, align 4, !tbaa !31
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [9 x i32], ptr @ply_type_size, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !25
  %64 = mul i32 %63, %52
  %65 = call noundef ptr @_Z8my_allociiPc(i32 noundef %64, i32 noundef 1703, ptr noundef nonnull @.str.9)
  store ptr %65, ptr %56, align 8, !tbaa !16
  %66 = icmp sgt i32 %52, 0
  br i1 %66, label %.lr.ph.split.preheader, label %.loopexit

.lr.ph.split.preheader:                           ; preds = %.thread85
  %67 = getelementptr inbounds i8, ptr %28, i64 8
  %68 = sext i32 %63 to i64
  br label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %40
  %69 = getelementptr inbounds i8, ptr %28, i64 8
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader, %.lr.ph.split.us
  %.06178.us = phi i32 [ %72, %.lr.ph.split.us ], [ 0, %.lr.ph.split.us.preheader ]
  %70 = load i32, ptr %24, align 8, !tbaa !23
  %71 = load i32, ptr %69, align 8, !tbaa !32
  call void @_Z15get_binary_itemP8_IO_FILEiiPiPjPd(ptr noundef %6, i32 noundef %70, i32 noundef %71, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %72 = add nuw nsw i32 %.06178.us, 1
  %exitcond83.not = icmp eq i32 %72, %41
  br i1 %exitcond83.not, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !33

.lr.ph.split:                                     ; preds = %.lr.ph.split.preheader, %.lr.ph.split
  %.06178 = phi i32 [ %80, %.lr.ph.split ], [ 0, %.lr.ph.split.preheader ]
  %.377 = phi ptr [ %79, %.lr.ph.split ], [ %65, %.lr.ph.split.preheader ]
  %73 = load i32, ptr %24, align 8, !tbaa !23
  %74 = load i32, ptr %67, align 8, !tbaa !32
  call void @_Z15get_binary_itemP8_IO_FILEiiPiPjPd(ptr noundef %6, i32 noundef %73, i32 noundef %74, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %75 = load i32, ptr %59, align 4, !tbaa !31
  %76 = load i32, ptr %3, align 4, !tbaa !25
  %77 = load i32, ptr %4, align 4, !tbaa !25
  %78 = load double, ptr %5, align 8, !tbaa !28
  call void @_Z10store_itemPciijd(ptr noundef %.377, i32 noundef %75, i32 noundef %76, i32 noundef %77, double noundef %78)
  %79 = getelementptr inbounds i8, ptr %.377, i64 %68
  %80 = add nuw nsw i32 %.06178, 1
  %exitcond.not = icmp eq i32 %80, %52
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph.split, !llvm.loop !33

81:                                               ; preds = %25
  %82 = getelementptr inbounds i8, ptr %28, i64 8
  %83 = load i32, ptr %82, align 8, !tbaa !32
  call void @_Z15get_binary_itemP8_IO_FILEiiPiPjPd(ptr noundef %6, i32 noundef %36, i32 noundef %83, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  br i1 %.not67, label %.loopexit, label %84

84:                                               ; preds = %81
  %85 = getelementptr inbounds i8, ptr %28, i64 16
  %86 = load i32, ptr %85, align 8, !tbaa !30
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i8, ptr %.060., i64 %87
  %89 = getelementptr inbounds i8, ptr %28, i64 12
  %90 = load i32, ptr %89, align 4, !tbaa !31
  %91 = load i32, ptr %3, align 4, !tbaa !25
  %92 = load i32, ptr %4, align 4, !tbaa !25
  %93 = load double, ptr %5, align 8, !tbaa !28
  call void @_Z10store_itemPciijd(ptr noundef %88, i32 noundef %90, i32 noundef %91, i32 noundef %92, double noundef %93)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.split, %.lr.ph.split.us, %.thread85, %40, %58, %84, %81
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %94 = load i32, ptr %19, align 8, !tbaa !17
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next, %95
  br i1 %96, label %25, label %._crit_edge, !llvm.loop !35

._crit_edge:                                      ; preds = %.loopexit, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z10store_itemPciijd(ptr noundef, i32 noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !7, i64 64}
!13 = !{!14, !10, i64 40}
!14 = !{!"_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}
!15 = !{!14, !10, i64 44}
!16 = !{!7, !7, i64 0}
!17 = !{!14, !10, i64 16}
!18 = !{!14, !7, i64 24}
!19 = !{!14, !7, i64 32}
!20 = !{!8, !8, i64 0}
!21 = !{!22, !10, i64 20}
!22 = !{!"_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}
!23 = !{!6, !10, i64 8}
!24 = !{!22, !10, i64 24}
!25 = !{!10, !10, i64 0}
!26 = !{!22, !10, i64 32}
!27 = !{!22, !10, i64 28}
!28 = !{!29, !29, i64 0}
!29 = !{!"double", !8, i64 0}
!30 = !{!22, !10, i64 16}
!31 = !{!22, !10, i64 12}
!32 = !{!22, !10, i64 8}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


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