; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src (trianglemesh)

; 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.vmath::vec3" = type { float, float, float }
%class.TriangleMesh = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.0", i32, i32, i32, double, %"class.std::vector.5", %"class.std::vector.10", %class.Array3d }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Array3d = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.15", i32, [4 x i8] }>
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN12TriangleMesh18_loadPLYVertexDataEPSt14basic_ifstreamIcSt11char_traitsIcEERNSt7__cxx1112basic_stringIcS2_SaIcEEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %"class.vmath::vec3", align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  %21 = alloca i8, align 1
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #8
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = call noundef zeroext i1 @_ZN12TriangleMesh26_getNumVerticesInPLYHeaderERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi(ptr noundef nonnull align 8 dereferenceable(232) %25, ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef %8)
  %28 = zext i1 %27 to i8
  store i8 %28, ptr %9, align 1, !tbaa !9
  %29 = load i8, ptr %9, align 1, !tbaa !9, !range !11, !noundef !12
  %30 = trunc i8 %29 to i1
  br i1 %30, label %32, label %31

31:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %165

32:                                               ; preds = %3
  %33 = load i32, ptr %8, align 4, !tbaa !13
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %165

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #8
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call noundef zeroext i1 @_ZN12TriangleMesh33_isVertexColorsEnabledInPLYHeaderERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(232) %25, ptr noundef nonnull align 8 dereferenceable(32) %37)
  %39 = zext i1 %38 to i8
  store i8 %39, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 12, ptr %12, align 4, !tbaa !13
  %40 = load i8, ptr %11, align 1, !tbaa !9, !range !11, !noundef !12
  %41 = trunc i8 %40 to i1
  br i1 %41, label %42, label %43

42:                                               ; preds = %36
  store i32 15, ptr %12, align 4, !tbaa !13
  br label %43

43:                                               ; preds = %42, %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %44 = load i32, ptr %8, align 4, !tbaa !13
  %45 = load i32, ptr %12, align 4, !tbaa !13
  %46 = mul nsw i32 %44, %45
  store i32 %46, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %47) #8
  %49 = trunc i64 %48 to i32
  store i32 %49, ptr %14, align 4, !tbaa !13
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load i32, ptr %14, align 4, !tbaa !13
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16) %50, i64 noundef %52, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %54 = load i32, ptr %13, align 4, !tbaa !13
  %55 = sext i32 %54 to i64
  %56 = call noalias noundef nonnull ptr @_Znam(i64 noundef %55) #9
  store ptr %56, ptr %15, align 8, !tbaa !5
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = load ptr, ptr %15, align 8, !tbaa !5
  %59 = load i32, ptr %13, align 4, !tbaa !13
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %57, ptr noundef %58, i64 noundef %60)
  %62 = load ptr, ptr %61, align 8, !tbaa !15
  %63 = getelementptr i8, ptr %62, i64 -24
  %64 = load i64, ptr %63, align 8
  %65 = getelementptr inbounds i8, ptr %61, i64 %64
  %66 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264) %65)
  br i1 %66, label %67, label %68

67:                                               ; preds = %43
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %164

68:                                               ; preds = %43
  %69 = getelementptr inbounds %class.TriangleMesh, ptr %25, i32 0, i32 0
  %70 = load i32, ptr %8, align 4, !tbaa !13
  %71 = sext i32 %70 to i64
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71)
  %72 = load i8, ptr %11, align 1, !tbaa !9, !range !11, !noundef !12
  %73 = trunc i8 %72 to i1
  br i1 %73, label %74, label %152

74:                                               ; preds = %68
  %75 = getelementptr inbounds %class.TriangleMesh, ptr %25, i32 0, i32 1
  %76 = load i32, ptr %8, align 4, !tbaa !13
  %77 = sext i32 %76 to i64
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %77)
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #8
  call void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !13
  br label %78

78:                                               ; preds = %134, %74
  %79 = load i32, ptr %18, align 4, !tbaa !13
  %80 = load i32, ptr %8, align 4, !tbaa !13
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %151

83:                                               ; preds = %78
  %84 = load ptr, ptr %15, align 8, !tbaa !5
  %85 = load i32, ptr %17, align 4, !tbaa !13
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %84, i64 %86
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 1 %87, i64 12, i1 false)
  %88 = load i32, ptr %17, align 4, !tbaa !13
  %89 = sext i32 %88 to i64
  %90 = add i64 %89, 12
  %91 = trunc i64 %90 to i32
  store i32 %91, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #8
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  %93 = load i32, ptr %17, align 4, !tbaa !13
  %94 = add nsw i32 %93, 0
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %92, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !17
  store i8 %97, ptr %19, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #8
  %98 = load ptr, ptr %15, align 8, !tbaa !5
  %99 = load i32, ptr %17, align 4, !tbaa !13
  %100 = add nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %98, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !17
  store i8 %103, ptr %20, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #8
  %104 = load ptr, ptr %15, align 8, !tbaa !5
  %105 = load i32, ptr %17, align 4, !tbaa !13
  %106 = add nsw i32 %105, 2
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i8, ptr %104, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !17
  store i8 %109, ptr %21, align 1, !tbaa !17
  %110 = load i32, ptr %17, align 4, !tbaa !13
  %111 = sext i32 %110 to i64
  %112 = add i64 %111, 3
  %113 = trunc i64 %112 to i32
  store i32 %113, ptr %17, align 4, !tbaa !13
  %114 = getelementptr inbounds %class.TriangleMesh, ptr %25, i32 0, i32 0
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %114, ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %115 unwind label %137

115:                                              ; preds = %83
  %116 = getelementptr inbounds %class.TriangleMesh, ptr %25, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #8
  %117 = load i8, ptr %19, align 1, !tbaa !17
  %118 = zext i8 %117 to i32
  %119 = sitofp i32 %118 to double
  %120 = fdiv double %119, 2.550000e+02
  %121 = fptrunc double %120 to float
  %122 = load i8, ptr %20, align 1, !tbaa !17
  %123 = zext i8 %122 to i32
  %124 = sitofp i32 %123 to double
  %125 = fdiv double %124, 2.550000e+02
  %126 = fptrunc double %125 to float
  %127 = load i8, ptr %21, align 1, !tbaa !17
  %128 = zext i8 %127 to i32
  %129 = sitofp i32 %128 to double
  %130 = fdiv double %129, 2.550000e+02
  %131 = fptrunc double %130 to float
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %24, float noundef %121, float noundef %126, float noundef %131)
          to label %132 unwind label %141

132:                                              ; preds = %115
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %116, ptr noundef nonnull align 4 dereferenceable(12) %24)
          to label %133 unwind label %145

133:                                              ; preds = %132
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %24) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #8
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %18, align 4, !tbaa !13
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %18, align 4, !tbaa !13
  br label %78, !llvm.loop !18

137:                                              ; preds = %83
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %22, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %23, align 4
  br label %150

141:                                              ; preds = %115
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %22, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %23, align 4
  br label %149

145:                                              ; preds = %132
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %22, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %23, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %24) #8
  br label %149

149:                                              ; preds = %145, %141
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  br label %150

150:                                              ; preds = %149, %137
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %167

151:                                              ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #8
  br label %159

152:                                              ; preds = %68
  %153 = getelementptr inbounds %class.TriangleMesh, ptr %25, i32 0, i32 0
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = load ptr, ptr %15, align 8, !tbaa !5
  %156 = load i32, ptr %8, align 4, !tbaa !13
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds %"class.vmath::vec3", ptr %155, i64 %157
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE6assignIPS1_vEEvT_S6_(ptr noundef nonnull align 8 dereferenceable(24) %153, ptr noundef %154, ptr noundef %158)
  br label %159

159:                                              ; preds = %152, %151
  %160 = load ptr, ptr %15, align 8, !tbaa !5
  %161 = icmp eq ptr %160, null
  br i1 %161, label %163, label %162

162:                                              ; preds = %159
  call void @_ZdaPv(ptr noundef %160) #10
  br label %163

163:                                              ; preds = %162, %159
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %164

164:                                              ; preds = %163, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  br label %165

165:                                              ; preds = %164, %35, %31
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  %166 = load i1, ptr %4, align 1
  ret i1 %166

167:                                              ; preds = %150
  %168 = load ptr, ptr %22, align 8
  %169 = load i32, ptr %23, align 4
  %170 = insertvalue { ptr, i32 } poison, ptr %168, 0
  %171 = insertvalue { ptr, i32 } %170, i32 %169, 1
  resume { ptr, i32 } %171
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN12TriangleMesh26_getNumVerticesInPLYHeaderERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN12TriangleMesh33_isVertexColorsEnabledInPLYHeaderERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

declare void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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 #7 = { 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 #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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; 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.vmath::vec3" = type { float, float, float }

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
define dso_local noundef zeroext i1 @_ZN12TriangleMesh18_loadPLYVertexDataEPSt14basic_ifstreamIcSt11char_traitsIcEERNSt7__cxx1112basic_stringIcS2_SaIcEEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca %"class.vmath::vec3", align 4
  %6 = alloca %"class.vmath::vec3", align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %7 = call noundef zeroext i1 @_ZN12TriangleMesh26_getNumVerticesInPLYHeaderERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull %4)
  br i1 %7, label %8, label %76

8:                                                ; preds = %3
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %76, label %11

11:                                               ; preds = %8
  %12 = call noundef zeroext i1 @_ZN12TriangleMesh33_isVertexColorsEnabledInPLYHeaderERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(32) %2)
  %spec.store.select = select i1 %12, i32 15, i32 12
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = mul nsw i32 %13, %spec.store.select
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  %sext = shl i64 %15, 32
  %16 = ashr exact i64 %sext, 32
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %16, i32 noundef 0)
  %18 = sext i32 %14 to i64
  %19 = call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #9
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %19, i64 noundef %18)
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr i8, ptr %21, i64 -24
  %23 = load i64, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr %20, i64 %23
  %25 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264) %24)
  br i1 %25, label %75, label %26

26:                                               ; preds = %11
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %28)
  br i1 %12, label %29, label %70

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %0, i64 24
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %32)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #8
  call void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %58, %29
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  br label %74

.lr.ph:                                           ; preds = %29, %58
  %.03847 = phi i64 [ %46, %58 ], [ 0, %29 ]
  %.03946 = phi i32 [ %59, %58 ], [ 0, %29 ]
  %sext40 = shl i64 %.03847, 32
  %35 = ashr exact i64 %sext40, 32
  %36 = getelementptr inbounds i8, ptr %19, i64 %35
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 1 dereferenceable(12) %36, i64 12, i1 false)
  %sext42 = add i64 %sext40, 51539607552
  %37 = ashr exact i64 %sext42, 32
  %38 = getelementptr inbounds i8, ptr %19, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %sext41 = add i64 %sext40, 55834574848
  %40 = ashr exact i64 %sext41, 32
  %41 = getelementptr inbounds i8, ptr %19, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %sext43 = add i64 %sext40, 60129542144
  %43 = ashr exact i64 %sext43, 32
  %44 = getelementptr inbounds i8, ptr %19, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = add nsw i64 %37, 3
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %47 unwind label %62

47:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #8
  %48 = uitofp i8 %39 to double
  %49 = fdiv double %48, 2.550000e+02
  %50 = fptrunc double %49 to float
  %51 = uitofp i8 %42 to double
  %52 = fdiv double %51, 2.550000e+02
  %53 = fptrunc double %52 to float
  %54 = uitofp i8 %45 to double
  %55 = fdiv double %54, 2.550000e+02
  %56 = fptrunc double %55 to float
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef %50, float noundef %53, float noundef %56)
          to label %57 unwind label %64

57:                                               ; preds = %47
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %58 unwind label %66

58:                                               ; preds = %57
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  %59 = add nuw nsw i32 %.03946, 1
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %.lr.ph, label %._crit_edge, !llvm.loop !12

62:                                               ; preds = %.lr.ph
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %69

64:                                               ; preds = %47
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %68

66:                                               ; preds = %57
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #8
  br label %68

68:                                               ; preds = %66, %64
  %.pn = phi { ptr, i32 } [ %67, %66 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  br label %69

69:                                               ; preds = %68, %62
  %.pn.pn = phi { ptr, i32 } [ %.pn, %68 ], [ %63, %62 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn.pn

70:                                               ; preds = %26
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds %"class.vmath::vec3", ptr %19, i64 %72
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE6assignIPS1_vEEvT_S6_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %19, ptr noundef nonnull %73)
  br label %74

74:                                               ; preds = %._crit_edge, %70
  call void @_ZdaPv(ptr noundef nonnull %19) #10
  br label %75

75:                                               ; preds = %11, %74
  %.036 = xor i1 %25, true
  br label %76

76:                                               ; preds = %8, %3, %75
  %.137 = phi i1 [ %.036, %75 ], [ false, %3 ], [ true, %8 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  ret i1 %.137
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN12TriangleMesh26_getNumVerticesInPLYHeaderERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN12TriangleMesh33_isVertexColorsEnabledInPLYHeaderERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

declare void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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 #7 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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