; LLVM IR from vectozavr/3dzavr :: engine/components/geometry (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.TriangleMesh = type <{ %class.Component, %"class.std::enable_shared_from_this", %"class.std::vector", %"class.std::shared_ptr", %struct.Bounds, i8, [7 x i8] }>
%class.Component = type { ptr, ptr }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%struct.Bounds = type { %class.Vec3D, %class.Vec3D }
%class.Vec3D = type { %"struct.std::array.6" }
%"struct.std::array.6" = type { [3 x double] }
%"class.std::initializer_list" = type { ptr, i64 }
%class.Triangle = type { %"struct.std::array.7", %"struct.std::array.9", %class.Vec3D }
%"struct.std::array.7" = type { [3 x %class.Vec4D] }
%class.Vec4D = type { %"struct.std::array.8" }
%"struct.std::array.8" = type { [4 x double] }
%"struct.std::array.9" = type { [3 x %class.Vec3D] }
%"class.std::allocator.3" = type { i8 }

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

declare i32 @__gxx_personality_v0(...)

; 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
declare dso_local void @_ZN12TriangleMesh12setTrianglesEOSt6vectorI8TriangleSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(121), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI8TriangleSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrI8MaterialEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh7SurfaceEddRKSt10shared_ptrI8MaterialE(ptr dead_on_unwind noalias writable sret(%class.TriangleMesh) align 8 %0, double noundef %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(16) %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i1, align 1
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"class.std::initializer_list", align 8
  %12 = alloca [2 x %class.Triangle], align 8
  %13 = alloca %"struct.std::array.7", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::array.9", align 8
  %17 = alloca %"struct.std::array.7", align 8
  %18 = alloca %"struct.std::array.9", align 8
  %19 = alloca %"class.std::allocator.3", align 1
  %20 = alloca %"class.std::shared_ptr", align 8
  store ptr %0, ptr %5, align 8
  store double %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !9
  store i1 false, ptr %9, align 1
  call void @_ZN12TriangleMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(121) %0) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 384, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 96, ptr %13) #5
  %21 = getelementptr inbounds %"struct.std::array.7", ptr %13, i32 0, i32 0
  %22 = load double, ptr %6, align 8, !tbaa !5
  %23 = fdiv double %22, 2.000000e+00
  %24 = load double, ptr %7, align 8, !tbaa !5
  %25 = fdiv double %24, 2.000000e+00
  invoke void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %21, double noundef %23, double noundef 0.000000e+00, double noundef %25, double noundef 1.000000e+00)
          to label %26 unwind label %91

26:                                               ; preds = %4
  %27 = getelementptr inbounds %class.Vec4D, ptr %21, i64 1
  %28 = load double, ptr %6, align 8, !tbaa !5
  %29 = fdiv double %28, 2.000000e+00
  %30 = load double, ptr %7, align 8, !tbaa !5
  %31 = fneg double %30
  %32 = fdiv double %31, 2.000000e+00
  invoke void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %27, double noundef %29, double noundef 0.000000e+00, double noundef %32, double noundef 1.000000e+00)
          to label %33 unwind label %91

33:                                               ; preds = %26
  %34 = getelementptr inbounds %class.Vec4D, ptr %21, i64 2
  %35 = load double, ptr %6, align 8, !tbaa !5
  %36 = fneg double %35
  %37 = fdiv double %36, 2.000000e+00
  %38 = load double, ptr %7, align 8, !tbaa !5
  %39 = fneg double %38
  %40 = fdiv double %39, 2.000000e+00
  invoke void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %34, double noundef %37, double noundef 0.000000e+00, double noundef %40, double noundef 1.000000e+00)
          to label %41 unwind label %91

41:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 72, ptr %16) #5
  %42 = getelementptr inbounds %"struct.std::array.9", ptr %16, i32 0, i32 0
  invoke void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %42, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %43 unwind label %95

43:                                               ; preds = %41
  %44 = getelementptr inbounds %class.Vec3D, ptr %42, i64 1
  invoke void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %44, double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 1.000000e+00)
          to label %45 unwind label %95

45:                                               ; preds = %43
  %46 = getelementptr inbounds %class.Vec3D, ptr %42, i64 2
  invoke void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %46, double noundef 1.000000e+00, double noundef 1.000000e+00, double noundef 1.000000e+00)
          to label %47 unwind label %95

47:                                               ; preds = %45
  invoke void @_ZN8TriangleC1ERKSt5arrayI5Vec4DLm3EERKS0_I5Vec3DLm3EE(ptr noundef nonnull align 8 dereferenceable(192) %12, ptr noundef nonnull align 8 dereferenceable(96) %13, ptr noundef nonnull align 8 dereferenceable(72) %16)
          to label %48 unwind label %95

48:                                               ; preds = %47
  %49 = getelementptr inbounds %class.Triangle, ptr %12, i64 1
  call void @llvm.lifetime.start.p0(i64 96, ptr %17) #5
  %50 = getelementptr inbounds %"struct.std::array.7", ptr %17, i32 0, i32 0
  %51 = load double, ptr %6, align 8, !tbaa !5
  %52 = fneg double %51
  %53 = fdiv double %52, 2.000000e+00
  %54 = load double, ptr %7, align 8, !tbaa !5
  %55 = fneg double %54
  %56 = fdiv double %55, 2.000000e+00
  invoke void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %50, double noundef %53, double noundef 0.000000e+00, double noundef %56, double noundef 1.000000e+00)
          to label %57 unwind label %99

57:                                               ; preds = %48
  %58 = getelementptr inbounds %class.Vec4D, ptr %50, i64 1
  %59 = load double, ptr %6, align 8, !tbaa !5
  %60 = fneg double %59
  %61 = fdiv double %60, 2.000000e+00
  %62 = load double, ptr %7, align 8, !tbaa !5
  %63 = fdiv double %62, 2.000000e+00
  invoke void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %58, double noundef %61, double noundef 0.000000e+00, double noundef %63, double noundef 1.000000e+00)
          to label %64 unwind label %99

64:                                               ; preds = %57
  %65 = getelementptr inbounds %class.Vec4D, ptr %50, i64 2
  %66 = load double, ptr %6, align 8, !tbaa !5
  %67 = fdiv double %66, 2.000000e+00
  %68 = load double, ptr %7, align 8, !tbaa !5
  %69 = fdiv double %68, 2.000000e+00
  invoke void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %65, double noundef %67, double noundef 0.000000e+00, double noundef %69, double noundef 1.000000e+00)
          to label %70 unwind label %99

70:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 72, ptr %18) #5
  %71 = getelementptr inbounds %"struct.std::array.9", ptr %18, i32 0, i32 0
  invoke void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %71, double noundef 1.000000e+00, double noundef 1.000000e+00, double noundef 1.000000e+00)
          to label %72 unwind label %103

72:                                               ; preds = %70
  %73 = getelementptr inbounds %class.Vec3D, ptr %71, i64 1
  invoke void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %73, double noundef 1.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %74 unwind label %103

74:                                               ; preds = %72
  %75 = getelementptr inbounds %class.Vec3D, ptr %71, i64 2
  invoke void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %75, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %76 unwind label %103

76:                                               ; preds = %74
  invoke void @_ZN8TriangleC1ERKSt5arrayI5Vec4DLm3EERKS0_I5Vec3DLm3EE(ptr noundef nonnull align 8 dereferenceable(192) %49, ptr noundef nonnull align 8 dereferenceable(96) %17, ptr noundef nonnull align 8 dereferenceable(72) %18)
          to label %77 unwind label %103

77:                                               ; preds = %76
  %78 = getelementptr inbounds %"class.std::initializer_list", ptr %11, i32 0, i32 0
  store ptr %12, ptr %78, align 8, !tbaa !11
  %79 = getelementptr inbounds %"class.std::initializer_list", ptr %11, i32 0, i32 1
  store i64 2, ptr %79, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  call void @_ZNSaI8TriangleEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  %80 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  %82 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 1
  %83 = load i64, ptr %82, align 8
  invoke void @_ZNSt6vectorI8TriangleSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr %81, i64 %83, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %84 unwind label %107

84:                                               ; preds = %77
  invoke void @_ZN12TriangleMesh12setTrianglesEOSt6vectorI8TriangleSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %85 unwind label %111

85:                                               ; preds = %84
  call void @_ZNSt6vectorI8TriangleSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @_ZNSt15__new_allocatorI8TriangleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 384, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  %86 = load ptr, ptr %8, align 8, !tbaa !9
  %87 = call noundef zeroext i1 @_ZNKSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %86) #5
  br i1 %87, label %88, label %124

88:                                               ; preds = %85
  %89 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_ZNSt10shared_ptrI8MaterialEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %89) #5
  invoke void @_ZN12TriangleMesh11setMaterialESt10shared_ptrI8MaterialE(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef %20)
          to label %90 unwind label %120

90:                                               ; preds = %88
  call void @_ZNSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  br label %124

91:                                               ; preds = %33, %26, %4
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %14, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %15, align 4
  br label %119

95:                                               ; preds = %47, %45, %43, %41
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %14, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %15, align 4
  br label %118

99:                                               ; preds = %64, %57, %48
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %14, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %15, align 4
  br label %117

103:                                              ; preds = %76, %74, %72, %70
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %14, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %15, align 4
  br label %116

107:                                              ; preds = %77
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %14, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %15, align 4
  br label %115

111:                                              ; preds = %84
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %14, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %15, align 4
  call void @_ZNSt6vectorI8TriangleSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  br label %115

115:                                              ; preds = %111, %107
  call void @_ZNSt15__new_allocatorI8TriangleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  br label %116

116:                                              ; preds = %115, %103
  call void @llvm.lifetime.end.p0(i64 72, ptr %18) #5
  br label %117

117:                                              ; preds = %116, %99
  call void @llvm.lifetime.end.p0(i64 96, ptr %17) #5
  br label %118

118:                                              ; preds = %117, %95
  call void @llvm.lifetime.end.p0(i64 72, ptr %16) #5
  br label %119

119:                                              ; preds = %118, %91
  call void @llvm.lifetime.end.p0(i64 96, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 384, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %128

120:                                              ; preds = %88
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %14, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %15, align 4
  call void @_ZNSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  br label %128

124:                                              ; preds = %90, %85
  store i1 true, ptr %9, align 1
  %125 = load i1, ptr %9, align 1
  br i1 %125, label %127, label %126

126:                                              ; preds = %124
  call void @_ZN12TriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %0) #5
  br label %127

127:                                              ; preds = %126, %124
  ret void

128:                                              ; preds = %120, %119
  call void @_ZN12TriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %0) #5
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr %14, align 8
  %131 = load i32, ptr %15, align 4
  %132 = insertvalue { ptr, i32 } poison, ptr %130, 0
  %133 = insertvalue { ptr, i32 } %132, i32 %131, 1
  resume { ptr, i32 } %133
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12TriangleMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(121)) unnamed_addr #2 align 2

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

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

declare void @_ZN8TriangleC1ERKSt5arrayI5Vec4DLm3EERKS0_I5Vec3DLm3EE(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaI8TriangleEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12TriangleMesh11setMaterialESt10shared_ptrI8MaterialE(ptr noundef nonnull align 8 dereferenceable(121), ptr noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI8TriangleED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSSt16initializer_listI8TriangleE", !10, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, 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"

%class.TriangleMesh = type <{ %class.Component, %"class.std::enable_shared_from_this", %"class.std::vector", %"class.std::shared_ptr", %struct.Bounds, i8, [7 x i8] }>
%class.Component = type { ptr, ptr }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%struct.Bounds = type { %class.Vec3D, %class.Vec3D }
%class.Vec3D = type { %"struct.std::array.6" }
%"struct.std::array.6" = type { [3 x double] }
%class.Triangle = type { %"struct.std::array.7", %"struct.std::array.9", %class.Vec3D }
%"struct.std::array.7" = type { [3 x %class.Vec4D] }
%class.Vec4D = type { %"struct.std::array.8" }
%"struct.std::array.8" = type { [4 x double] }
%"struct.std::array.9" = type { [3 x %class.Vec3D] }
%"class.std::allocator.3" = type { i8 }

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

declare i32 @__gxx_personality_v0(...)

; 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
declare dso_local void @_ZN12TriangleMesh12setTrianglesEOSt6vectorI8TriangleSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(121), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI8TriangleSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrI8MaterialEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh7SurfaceEddRKSt10shared_ptrI8MaterialE(ptr dead_on_unwind noalias nonnull writable sret(%class.TriangleMesh) align 8 %0, double noundef %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(16) %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca [2 x %class.Triangle], align 8
  %7 = alloca %"struct.std::array.7", align 8
  %8 = alloca %"struct.std::array.9", align 8
  %9 = alloca %"struct.std::array.7", align 8
  %10 = alloca %"struct.std::array.9", align 8
  %11 = alloca %"class.std::allocator.3", align 1
  %12 = alloca %"class.std::shared_ptr", align 8
  tail call void @_ZN12TriangleMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(121) %0) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %7) #5
  %13 = fmul double %1, 5.000000e-01
  %14 = fmul double %2, 5.000000e-01
  call void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %7, double noundef %13, double noundef 0.000000e+00, double noundef %14, double noundef 1.000000e+00)
  %15 = getelementptr inbounds i8, ptr %7, i64 32
  %16 = fmul double %2, -5.000000e-01
  call void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %15, double noundef %13, double noundef 0.000000e+00, double noundef %16, double noundef 1.000000e+00)
  %17 = getelementptr inbounds i8, ptr %7, i64 64
  %18 = fmul double %1, -5.000000e-01
  call void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %17, double noundef %18, double noundef 0.000000e+00, double noundef %16, double noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %8) #5
  call void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %8, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
  %19 = getelementptr inbounds i8, ptr %8, i64 24
  call void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %19, double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 1.000000e+00)
  %20 = getelementptr inbounds i8, ptr %8, i64 48
  call void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %20, double noundef 1.000000e+00, double noundef 1.000000e+00, double noundef 1.000000e+00)
  invoke void @_ZN8TriangleC1ERKSt5arrayI5Vec4DLm3EERKS0_I5Vec3DLm3EE(ptr noundef nonnull align 8 dereferenceable(192) %6, ptr noundef nonnull align 8 dereferenceable(96) %7, ptr noundef nonnull align 8 dereferenceable(72) %8)
          to label %21 unwind label %32

21:                                               ; preds = %4
  %22 = getelementptr inbounds i8, ptr %6, i64 192
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %9) #5
  call void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %9, double noundef %18, double noundef 0.000000e+00, double noundef %16, double noundef 1.000000e+00)
  %23 = getelementptr inbounds i8, ptr %9, i64 32
  call void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %23, double noundef %18, double noundef 0.000000e+00, double noundef %14, double noundef 1.000000e+00)
  %24 = getelementptr inbounds i8, ptr %9, i64 64
  call void @_ZN5Vec4DC2Edddd(ptr noundef nonnull align 8 dereferenceable(32) %24, double noundef %13, double noundef 0.000000e+00, double noundef %14, double noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %10) #5
  call void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %10, double noundef 1.000000e+00, double noundef 1.000000e+00, double noundef 1.000000e+00)
  %25 = getelementptr inbounds i8, ptr %10, i64 24
  call void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %25, double noundef 1.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
  %26 = getelementptr inbounds i8, ptr %10, i64 48
  call void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %26, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
  invoke void @_ZN8TriangleC1ERKSt5arrayI5Vec4DLm3EERKS0_I5Vec3DLm3EE(ptr noundef nonnull align 8 dereferenceable(192) %22, ptr noundef nonnull align 8 dereferenceable(96) %9, ptr noundef nonnull align 8 dereferenceable(72) %10)
          to label %27 unwind label %34

27:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #5
  call void @_ZNSaI8TriangleEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  invoke void @_ZNSt6vectorI8TriangleSaIS0_EEC2ESt16initializer_listIS0_ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr nonnull %6, i64 2, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %28 unwind label %36

28:                                               ; preds = %27
  invoke void @_ZN12TriangleMesh12setTrianglesEOSt6vectorI8TriangleSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %29 unwind label %38

29:                                               ; preds = %28
  call void @_ZNSt6vectorI8TriangleSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @_ZNSt15__new_allocatorI8TriangleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  %30 = call noundef zeroext i1 @_ZNKSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  br i1 %30, label %31, label %43

31:                                               ; preds = %29
  call void @_ZNSt10shared_ptrI8MaterialEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @_ZN12TriangleMesh11setMaterialESt10shared_ptrI8MaterialE(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull %12)
  call void @_ZNSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #5
  br label %43

32:                                               ; preds = %4
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %42

34:                                               ; preds = %21
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %41

36:                                               ; preds = %27
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %40

38:                                               ; preds = %28
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorI8TriangleSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %40

40:                                               ; preds = %38, %36
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ]
  call void @_ZNSt15__new_allocatorI8TriangleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  br label %41

41:                                               ; preds = %40, %34
  %.pn.pn = phi { ptr, i32 } [ %.pn, %40 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %9) #5
  br label %42

42:                                               ; preds = %41, %32
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %41 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN12TriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(121) %0) #5
  resume { ptr, i32 } %.pn.pn.pn

43:                                               ; preds = %29, %31
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12TriangleMeshC2Ev(ptr noundef nonnull align 8 dereferenceable(121)) unnamed_addr #2 align 2

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

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

declare void @_ZN8TriangleC1ERKSt5arrayI5Vec4DLm3EERKS0_I5Vec3DLm3EE(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaI8TriangleEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12TriangleMesh11setMaterialESt10shared_ptrI8MaterialE(ptr noundef nonnull align 8 dereferenceable(121), ptr noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrI8MaterialLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI8TriangleED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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,TailCallElimPass