; LLVM IR from zeux/meshoptimizer :: demo/main.ll (Z8optimizeRK4MeshPKcPFvRS_E)

; 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.Mesh = type { %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Vertex, std::allocator<Vertex>>::_Vector_impl" }
%"struct.std::_Vector_base<Vertex, std::allocator<Vertex>>::_Vector_impl" = type { %"struct.std::_Vector_base<Vertex, std::allocator<Vertex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Vertex, std::allocator<Vertex>>::_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<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.meshopt_VertexCacheStatistics = type { i32, i32, float, float }
%struct.meshopt_VertexFetchStatistics = type { i32, float }
%struct.meshopt_OverdrawStatistics = type { i32, i32, float }
%struct.Vertex = type { float, float, float, float, float, float, float, float }

@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [66 x i8], align 1
@__PRETTY_FUNCTION__._Z8optimizeRK4MeshPKcPFvRS_E = external hidden unnamed_addr constant [60 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.20 = 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z9timestampv() #1

declare i32 @printf(ptr noundef, ...) #2

declare i32 @__gxx_personality_v0(...)

; 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(32) ptr @_ZNSt6vectorI6VertexSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z11isMeshValidRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z8hashMeshRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48)) #1

declare { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare i64 @meshopt_analyzeVertexFetch(ptr noundef, i64 noundef, i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8optimizeRK4MeshPKcPFvRS_E(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1, ptr noundef %2) #5 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.Mesh, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca %struct.meshopt_VertexCacheStatistics, align 4
  %13 = alloca %struct.meshopt_VertexFetchStatistics, align 4
  %14 = alloca %struct.meshopt_OverdrawStatistics, align 4
  %15 = alloca { i64, float }, align 8
  %16 = alloca %struct.meshopt_VertexCacheStatistics, align 4
  %17 = alloca %struct.meshopt_VertexCacheStatistics, align 4
  %18 = alloca %struct.meshopt_VertexCacheStatistics, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #8
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4MeshC2ERKS_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(48) %19)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %20 = call noundef double @_Z9timestampv()
  store double %20, ptr %8, align 8, !tbaa !9
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void %21(ptr noundef nonnull align 8 dereferenceable(48) %7)
          to label %22 unwind label %27

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %23 = call noundef double @_Z9timestampv()
  store double %23, ptr %11, align 8, !tbaa !9
  %24 = call noundef zeroext i1 @_Z11isMeshValidRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48) %7)
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  br label %32

26:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.18, i32 noundef 774, ptr noundef @__PRETTY_FUNCTION__._Z8optimizeRK4MeshPKcPFvRS_E) #9
  unreachable

27:                                               ; preds = %3
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %9, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %10, align 4
  br label %165

31:                                               ; No predecessors!
  br label %32

32:                                               ; preds = %31, %25
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = call noundef i32 @_Z8hashMeshRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48) %33)
  %35 = call noundef i32 @_Z8hashMeshRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48) %7)
  %36 = icmp eq i32 %34, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %32
  br label %40

38:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.18, i32 noundef 775, ptr noundef @__PRETTY_FUNCTION__._Z8optimizeRK4MeshPKcPFvRS_E) #9
  unreachable

39:                                               ; No predecessors!
  br label %40

40:                                               ; preds = %39, %37
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  %41 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef 0) #8
  %43 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %44 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #8
  %45 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 0
  %46 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #8
  %47 = invoke { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef %42, i64 noundef %44, i64 noundef %46, i32 noundef 16, i32 noundef 0, i32 noundef 0)
          to label %48 unwind label %136

48:                                               ; preds = %40
  %49 = getelementptr inbounds { i64, <2 x float> }, ptr %12, i32 0, i32 0
  %50 = extractvalue { i64, <2 x float> } %47, 0
  store i64 %50, ptr %49, align 4
  %51 = getelementptr inbounds { i64, <2 x float> }, ptr %12, i32 0, i32 1
  %52 = extractvalue { i64, <2 x float> } %47, 1
  store <2 x float> %52, ptr %51, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %53 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef 0) #8
  %55 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %56 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %55) #8
  %57 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 0
  %58 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #8
  %59 = invoke i64 @meshopt_analyzeVertexFetch(ptr noundef %54, i64 noundef %56, i64 noundef %58, i64 noundef 32)
          to label %60 unwind label %140

60:                                               ; preds = %48
  store i64 %59, ptr %13, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #8
  %61 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef 0) #8
  %63 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %64 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #8
  %65 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 0
  %66 = call noundef nonnull align 4 dereferenceable(32) ptr @_ZNSt6vectorI6VertexSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef 0) #8
  %67 = getelementptr inbounds %struct.Vertex, ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 0
  %69 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %68) #8
  %70 = invoke { i64, float } @meshopt_analyzeOverdraw(ptr noundef %62, i64 noundef %64, ptr noundef %67, i64 noundef %69, i64 noundef 32)
          to label %71 unwind label %144

71:                                               ; preds = %60
  store { i64, float } %70, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %15, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  %72 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %72, i64 noundef 0) #8
  %74 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %75 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #8
  %76 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 0
  %77 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #8
  %78 = invoke { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef %73, i64 noundef %75, i64 noundef %77, i32 noundef 32, i32 noundef 32, i32 noundef 32)
          to label %79 unwind label %148

79:                                               ; preds = %71
  %80 = getelementptr inbounds { i64, <2 x float> }, ptr %16, i32 0, i32 0
  %81 = extractvalue { i64, <2 x float> } %78, 0
  store i64 %81, ptr %80, align 4
  %82 = getelementptr inbounds { i64, <2 x float> }, ptr %16, i32 0, i32 1
  %83 = extractvalue { i64, <2 x float> } %78, 1
  store <2 x float> %83, ptr %82, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  %84 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef 0) #8
  %86 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %87 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #8
  %88 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 0
  %89 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #8
  %90 = invoke { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef %85, i64 noundef %87, i64 noundef %89, i32 noundef 14, i32 noundef 64, i32 noundef 128)
          to label %91 unwind label %152

91:                                               ; preds = %79
  %92 = getelementptr inbounds { i64, <2 x float> }, ptr %17, i32 0, i32 0
  %93 = extractvalue { i64, <2 x float> } %90, 0
  store i64 %93, ptr %92, align 4
  %94 = getelementptr inbounds { i64, <2 x float> }, ptr %17, i32 0, i32 1
  %95 = extractvalue { i64, <2 x float> } %90, 1
  store <2 x float> %95, ptr %94, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #8
  %96 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %96, i64 noundef 0) #8
  %98 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 1
  %99 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #8
  %100 = getelementptr inbounds %struct.Mesh, ptr %7, i32 0, i32 0
  %101 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %100) #8
  %102 = invoke { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef %97, i64 noundef %99, i64 noundef %101, i32 noundef 128, i32 noundef 0, i32 noundef 0)
          to label %103 unwind label %156

103:                                              ; preds = %91
  %104 = getelementptr inbounds { i64, <2 x float> }, ptr %18, i32 0, i32 0
  %105 = extractvalue { i64, <2 x float> } %102, 0
  store i64 %105, ptr %104, align 4
  %106 = getelementptr inbounds { i64, <2 x float> }, ptr %18, i32 0, i32 1
  %107 = extractvalue { i64, <2 x float> } %102, 1
  store <2 x float> %107, ptr %106, align 4
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.meshopt_VertexCacheStatistics, ptr %12, i32 0, i32 2
  %110 = load float, ptr %109, align 4, !tbaa !11
  %111 = fpext float %110 to double
  %112 = getelementptr inbounds %struct.meshopt_VertexCacheStatistics, ptr %12, i32 0, i32 3
  %113 = load float, ptr %112, align 4, !tbaa !15
  %114 = fpext float %113 to double
  %115 = getelementptr inbounds %struct.meshopt_VertexCacheStatistics, ptr %16, i32 0, i32 3
  %116 = load float, ptr %115, align 4, !tbaa !15
  %117 = fpext float %116 to double
  %118 = getelementptr inbounds %struct.meshopt_VertexCacheStatistics, ptr %17, i32 0, i32 3
  %119 = load float, ptr %118, align 4, !tbaa !15
  %120 = fpext float %119 to double
  %121 = getelementptr inbounds %struct.meshopt_VertexCacheStatistics, ptr %18, i32 0, i32 3
  %122 = load float, ptr %121, align 4, !tbaa !15
  %123 = fpext float %122 to double
  %124 = getelementptr inbounds %struct.meshopt_VertexFetchStatistics, ptr %13, i32 0, i32 1
  %125 = load float, ptr %124, align 4, !tbaa !16
  %126 = fpext float %125 to double
  %127 = getelementptr inbounds %struct.meshopt_OverdrawStatistics, ptr %14, i32 0, i32 2
  %128 = load float, ptr %127, align 4, !tbaa !18
  %129 = fpext float %128 to double
  %130 = load double, ptr %11, align 8, !tbaa !9
  %131 = load double, ptr %8, align 8, !tbaa !9
  %132 = fsub double %130, %131
  %133 = fmul double %132, 1.000000e+03
  %134 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.20, ptr noundef %108, double noundef %111, double noundef %114, double noundef %117, double noundef %120, double noundef %123, double noundef %126, double noundef %129, double noundef %133)
          to label %135 unwind label %156

135:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #8
  ret void

136:                                              ; preds = %40
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %9, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %10, align 4
  br label %164

140:                                              ; preds = %48
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %9, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %10, align 4
  br label %163

144:                                              ; preds = %60
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %9, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %10, align 4
  br label %162

148:                                              ; preds = %71
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %9, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %10, align 4
  br label %161

152:                                              ; preds = %79
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %9, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %10, align 4
  br label %160

156:                                              ; preds = %103, %91
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %9, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  br label %160

160:                                              ; preds = %156, %152
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  br label %161

161:                                              ; preds = %160, %148
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  br label %162

162:                                              ; preds = %161, %144
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #8
  br label %163

163:                                              ; preds = %162, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %164

164:                                              ; preds = %163, %136
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %165

165:                                              ; preds = %164, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #8
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %9, align 8
  %168 = load i32, ptr %10, align 4
  %169 = insertvalue { ptr, i32 } poison, ptr %167, 0
  %170 = insertvalue { ptr, i32 } %169, i32 %168, 1
  resume { ptr, i32 } %170
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4MeshC2ERKS_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

declare { i64, float } @meshopt_analyzeOverdraw(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 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 = { "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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !14, i64 8}
!12 = !{!"_ZTS29meshopt_VertexCacheStatistics", !13, i64 0, !13, i64 4, !14, i64 8, !14, i64 12}
!13 = !{!"int", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!12, !14, i64 12}
!16 = !{!17, !14, i64 4}
!17 = !{!"_ZTS29meshopt_VertexFetchStatistics", !13, i64 0, !14, i64 4}
!18 = !{!19, !14, i64 8}
!19 = !{!"_ZTS26meshopt_OverdrawStatistics", !13, i64 0, !13, i64 4, !14, i64 8}


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

%struct.Mesh = type { %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Vertex, std::allocator<Vertex>>::_Vector_impl" }
%"struct.std::_Vector_base<Vertex, std::allocator<Vertex>>::_Vector_impl" = type { %"struct.std::_Vector_base<Vertex, std::allocator<Vertex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Vertex, std::allocator<Vertex>>::_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<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [66 x i8], align 1
@__PRETTY_FUNCTION__._Z8optimizeRK4MeshPKcPFvRS_E = external hidden unnamed_addr constant [60 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.20 = 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z9timestampv() local_unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z11isMeshValidRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z8hashMeshRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1

declare { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

declare i64 @meshopt_analyzeVertexFetch(ptr noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8optimizeRK4MeshPKcPFvRS_E(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.Mesh, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #8
  call void @_ZN4MeshC2ERKS_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(48) %0)
  %5 = call noundef double @_Z9timestampv()
  invoke void %2(ptr noundef nonnull align 8 dereferenceable(48) %4)
          to label %6 unwind label %10

6:                                                ; preds = %3
  %7 = call noundef double @_Z9timestampv()
  %8 = call noundef zeroext i1 @_Z11isMeshValidRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48) %4)
  br i1 %8, label %12, label %9

9:                                                ; preds = %6
  call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.18, i32 noundef 774, ptr noundef nonnull @__PRETTY_FUNCTION__._Z8optimizeRK4MeshPKcPFvRS_E) #9
  unreachable

10:                                               ; preds = %3
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %77

12:                                               ; preds = %6
  %13 = call noundef i32 @_Z8hashMeshRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %14 = call noundef i32 @_Z8hashMeshRK4Mesh(ptr noundef nonnull align 8 dereferenceable(48) %4)
  %15 = icmp eq i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.18, i32 noundef 775, ptr noundef nonnull @__PRETTY_FUNCTION__._Z8optimizeRK4MeshPKcPFvRS_E) #9
  unreachable

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %4, i64 24
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0) #8
  %20 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %21 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %22 = invoke { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef nonnull %19, i64 noundef %20, i64 noundef %21, i32 noundef 16, i32 noundef 0, i32 noundef 0)
          to label %23 unwind label %65

23:                                               ; preds = %17
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0) #8
  %25 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %26 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %27 = invoke i64 @meshopt_analyzeVertexFetch(ptr noundef nonnull %24, i64 noundef %25, i64 noundef %26, i64 noundef 32)
          to label %28 unwind label %67

28:                                               ; preds = %23
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0) #8
  %30 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %31 = call noundef nonnull align 4 dereferenceable(32) ptr @_ZNSt6vectorI6VertexSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #8
  %32 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %33 = invoke { i64, float } @meshopt_analyzeOverdraw(ptr noundef nonnull %29, i64 noundef %30, ptr noundef nonnull %31, i64 noundef %32, i64 noundef 32)
          to label %34 unwind label %69

34:                                               ; preds = %28
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0) #8
  %36 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %37 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %38 = invoke { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef nonnull %35, i64 noundef %36, i64 noundef %37, i32 noundef 32, i32 noundef 32, i32 noundef 32)
          to label %39 unwind label %71

39:                                               ; preds = %34
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0) #8
  %41 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %42 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %43 = invoke { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef nonnull %40, i64 noundef %41, i64 noundef %42, i32 noundef 14, i32 noundef 64, i32 noundef 128)
          to label %44 unwind label %73

44:                                               ; preds = %39
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0) #8
  %46 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %47 = call noundef i64 @_ZNKSt6vectorI6VertexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %48 = invoke { i64, <2 x float> } @meshopt_analyzeVertexCache(ptr noundef nonnull %45, i64 noundef %46, i64 noundef %47, i32 noundef 128, i32 noundef 0, i32 noundef 0)
          to label %49 unwind label %75

49:                                               ; preds = %44
  %50 = extractvalue { i64, <2 x float> } %43, 1
  %51 = extractvalue { i64, <2 x float> } %38, 1
  %.fca.1.extract = extractvalue { i64, float } %33, 1
  %.sroa.49.0.extract.shift = lshr i64 %27, 32
  %.sroa.49.0.extract.trunc = trunc nuw i64 %.sroa.49.0.extract.shift to i32
  %52 = bitcast i32 %.sroa.49.0.extract.trunc to float
  %53 = extractvalue { i64, <2 x float> } %22, 1
  %54 = extractvalue { i64, <2 x float> } %48, 1
  %.sroa.411.8.vec.extract = extractelement <2 x float> %53, i64 0
  %55 = fpext float %.sroa.411.8.vec.extract to double
  %.sroa.411.12.vec.extract = extractelement <2 x float> %53, i64 1
  %56 = fpext float %.sroa.411.12.vec.extract to double
  %.sroa.44.12.vec.extract = extractelement <2 x float> %51, i64 1
  %57 = fpext float %.sroa.44.12.vec.extract to double
  %.sroa.42.12.vec.extract = extractelement <2 x float> %50, i64 1
  %58 = fpext float %.sroa.42.12.vec.extract to double
  %.sroa.4.12.vec.extract = extractelement <2 x float> %54, i64 1
  %59 = fpext float %.sroa.4.12.vec.extract to double
  %60 = fpext float %52 to double
  %61 = fpext float %.fca.1.extract to double
  %62 = fsub double %7, %5
  %63 = fmul double %62, 1.000000e+03
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, ptr noundef %1, double noundef %55, double noundef %56, double noundef %57, double noundef %58, double noundef %59, double noundef %60, double noundef %61, double noundef %63)
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  ret void

65:                                               ; preds = %17
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %77

67:                                               ; preds = %23
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %77

69:                                               ; preds = %28
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %77

71:                                               ; preds = %34
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %77

73:                                               ; preds = %39
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %77

75:                                               ; preds = %44
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %77

77:                                               ; preds = %65, %69, %73, %75, %71, %67, %10
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %11, %10 ], [ %66, %65 ], [ %68, %67 ], [ %70, %69 ], [ %72, %71 ], [ %76, %75 ], [ %74, %73 ]
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4MeshC2ERKS_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

declare { i64, float } @meshopt_analyzeOverdraw(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #4

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass