; LLVM IR from jasonlmfong/Model-Modifier :: Model-Modifier/src/scene/surface/Surface.ll (ZN7Surface14ComputeQuadricE12VertexRecord)

; 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.glm::mat" = type { [4 x %"struct.glm::vec.137"] }
%"struct.glm::vec.137" = type { %union.anon.138, %union.anon.139, %union.anon.140, %union.anon.141 }
%union.anon.138 = type { float }
%union.anon.139 = type { float }
%union.anon.140 = type { float }
%union.anon.141 = type { float }
%"struct.glm::vec" = type { %union.anon, %union.anon.0, %union.anon.1 }
%union.anon = type { float }
%union.anon.0 = type { float }
%union.anon.1 = type { float }
%"class.__gnu_cxx::__normal_iterator.142" = type { ptr }
%struct.FaceRecord = type { %"struct.glm::vec", %"class.std::vector.107", %"class.std::unordered_map.123", %"class.std::vector.107" }
%"class.std::unordered_map.123" = type { %"class.std::_Hashtable.124" }
%"class.std::_Hashtable.124" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::vector.107" = type { %"struct.std::_Vector_base.108" }
%"struct.std::_Vector_base.108" = 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.VertexRecord = type { %"struct.glm::vec", %"class.std::vector.107", %"class.std::vector.107" }
%class.Surface = type { %"class.std::vector.52", %"class.std::vector.57", %"class.std::vector.62", %"struct.glm::vec", %"struct.glm::vec", %"class.std::unordered_map.67" }
%"class.std::vector.52" = type { %"struct.std::_Vector_base.53" }
%"struct.std::_Vector_base.53" = type { %"struct.std::_Vector_base<VertexRecord, std::allocator<VertexRecord>>::_Vector_impl" }
%"struct.std::_Vector_base<VertexRecord, std::allocator<VertexRecord>>::_Vector_impl" = type { %"struct.std::_Vector_base<VertexRecord, std::allocator<VertexRecord>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VertexRecord, std::allocator<VertexRecord>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.57" = type { %"struct.std::_Vector_base.58" }
%"struct.std::_Vector_base.58" = type { %"struct.std::_Vector_base<EdgeRecord, std::allocator<EdgeRecord>>::_Vector_impl" }
%"struct.std::_Vector_base<EdgeRecord, std::allocator<EdgeRecord>>::_Vector_impl" = type { %"struct.std::_Vector_base<EdgeRecord, std::allocator<EdgeRecord>>::_Vector_impl_data" }
%"struct.std::_Vector_base<EdgeRecord, std::allocator<EdgeRecord>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.62" = type { %"struct.std::_Vector_base.63" }
%"struct.std::_Vector_base.63" = type { %"struct.std::_Vector_base<FaceRecord, std::allocator<FaceRecord>>::_Vector_impl" }
%"struct.std::_Vector_base<FaceRecord, std::allocator<FaceRecord>>::_Vector_impl" = type { %"struct.std::_Vector_base<FaceRecord, std::allocator<FaceRecord>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FaceRecord, std::allocator<FaceRecord>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map.67" = type { %"class.std::_Hashtable.68" }
%"class.std::_Hashtable.68" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }

; 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) #0

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN7Surface17ComputeFaceNormalE10FaceRecord(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Surface14ComputeQuadricE12VertexRecord(ptr dead_on_unwind noalias writable sret(%"struct.glm::mat") align 4 %0, ptr noundef nonnull align 8 dereferenceable(152) %1, ptr noundef %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.glm::vec", align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.142", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.142", align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.FaceRecord, align 8
  %12 = alloca %"struct.glm::vec", align 4
  %13 = alloca %struct.FaceRecord, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca { <2 x float>, float }, align 8
  %17 = alloca %"struct.glm::vec.137", align 4
  %18 = alloca %"struct.glm::mat", align 4
  store ptr %1, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8
  call void @llvm.memset.p0.i64(ptr align 4 %0, i8 0, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #8
  %20 = getelementptr inbounds %struct.VertexRecord, ptr %2, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %20, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %21 = getelementptr inbounds %struct.VertexRecord, ptr %2, i32 0, i32 2
  store ptr %21, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call ptr @_ZNSt6vectorIjSaIjEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #8
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.142", ptr %8, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = call ptr @_ZNSt6vectorIjSaIjEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.142", ptr %9, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  br label %28

28:                                               ; preds = %48, %3
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  br i1 %29, label %31, label %30

30:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %68

31:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %33 = load i32, ptr %32, align 4, !tbaa !11
  store i32 %33, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 120, ptr %11) #8
  %34 = getelementptr inbounds %class.Surface, ptr %19, i32 0, i32 2
  %35 = load i32, ptr %10, align 4, !tbaa !11
  %36 = zext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI10FaceRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %36) #8
  call void @_ZN10FaceRecordC2ERKS_(ptr noundef nonnull align 8 dereferenceable(120) %11, ptr noundef nonnull align 8 dereferenceable(120) %37)
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #8
  invoke void @_ZN10FaceRecordC2ERKS_(ptr noundef nonnull align 8 dereferenceable(120) %13, ptr noundef nonnull align 8 dereferenceable(120) %11)
          to label %38 unwind label %50

38:                                               ; preds = %31
  %39 = invoke { <2 x float>, float } @_ZN7Surface17ComputeFaceNormalE10FaceRecord(ptr noundef nonnull align 8 dereferenceable(152) %19, ptr noundef %13)
          to label %40 unwind label %54

40:                                               ; preds = %38
  store { <2 x float>, float } %39, ptr %16, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %16, i64 12, i1 false)
  call void @_ZN10FaceRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %13) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  %41 = invoke noundef float @_ZN3glm3dotILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEES6_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %42 unwind label %58

42:                                               ; preds = %40
  %43 = fneg float %41
  invoke void @_ZN3glm3vecILi4EfLNS_9qualifierE0EEC2IffLS1_0EEERKNS0_ILi3ET_XT1_EEET0_(ptr noundef nonnull align 4 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef %43)
          to label %44 unwind label %58

44:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 64, ptr %18) #8
  invoke void @_ZN3glm12outerProductILi4ELi4EfLNS_9qualifierE0EEENS_6detail18outerProduct_traitIXT_EXT0_ET1_XT2_EE4typeERKNS_3vecIXT_ES4_XT2_EEERKNS7_IXT0_ES4_XT2_EEE(ptr dead_on_unwind writable sret(%"struct.glm::mat") align 4 %18, ptr noundef nonnull align 4 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(16) %17)
          to label %45 unwind label %62

45:                                               ; preds = %44
  %46 = invoke noundef nonnull align 4 dereferenceable(64) ptr @_ZN3glm3matILi4ELi4EfLNS_9qualifierE0EEpLIfEERS2_RKNS0_ILi4ELi4ET_LS1_0EEE(ptr noundef nonnull align 4 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(64) %18)
          to label %47 unwind label %62

47:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #8
  call void @_ZN10FaceRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %11) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %48

48:                                               ; preds = %47
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  br label %28

50:                                               ; preds = %31
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %14, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %15, align 4
  br label %67

54:                                               ; preds = %38
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %14, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %15, align 4
  call void @_ZN10FaceRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %13) #8
  br label %67

58:                                               ; preds = %42, %40
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %14, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %15, align 4
  br label %66

62:                                               ; preds = %45, %44
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %14, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #8
  br label %66

66:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  br label %67

67:                                               ; preds = %66, %54, %50
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #8
  call void @_ZN10FaceRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %11) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #8
  br label %69

68:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #8
  ret void

69:                                               ; preds = %67
  %70 = load ptr, ptr %14, align 8
  %71 = load i32, ptr %15, align 4
  %72 = insertvalue { ptr, i32 } poison, ptr %70, 0
  %73 = insertvalue { ptr, i32 } %72, i32 %71, 1
  resume { ptr, i32 } %73
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI10FaceRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3glm3dotILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEES6_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3glm3vecILi4EfLNS_9qualifierE0EEC2IffLS1_0EEERKNS0_ILi3ET_XT1_EEET0_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), float noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm12outerProductILi4ELi4EfLNS_9qualifierE0EEENS_6detail18outerProduct_traitIXT_EXT0_ET1_XT2_EE4typeERKNS_3vecIXT_ES4_XT2_EEERKNS7_IXT0_ES4_XT2_EEE(ptr dead_on_unwind noalias writable sret(%"struct.glm::mat") align 4, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(64) ptr @_ZN3glm3matILi4ELi4EfLNS_9qualifierE0EEpLIfEERS2_RKNS0_ILi4ELi4ET_LS1_0EEE(ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #5 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { 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 #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 = { inlinehint 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 #8 = { 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 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


; 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.glm::mat" = type { [4 x %"struct.glm::vec.137"] }
%"struct.glm::vec.137" = type { %union.anon.138, %union.anon.139, %union.anon.140, %union.anon.141 }
%union.anon.138 = type { float }
%union.anon.139 = type { float }
%union.anon.140 = type { float }
%union.anon.141 = type { float }
%"struct.glm::vec" = type { %union.anon, %union.anon.0, %union.anon.1 }
%union.anon = type { float }
%union.anon.0 = type { float }
%union.anon.1 = type { float }
%"class.__gnu_cxx::__normal_iterator.142" = type { ptr }
%struct.FaceRecord = type { %"struct.glm::vec", %"class.std::vector.107", %"class.std::unordered_map.123", %"class.std::vector.107" }
%"class.std::unordered_map.123" = type { %"class.std::_Hashtable.124" }
%"class.std::_Hashtable.124" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::vector.107" = type { %"struct.std::_Vector_base.108" }
%"struct.std::_Vector_base.108" = 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 }

; 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) #0

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN7Surface17ComputeFaceNormalE10FaceRecord(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Surface14ComputeQuadricE12VertexRecord(ptr dead_on_unwind noalias writable sret(%"struct.glm::mat") align 4 %0, ptr noundef nonnull align 8 dereferenceable(152) %1, ptr noundef %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.glm::vec", align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.142", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.142", align 8
  %7 = alloca %struct.FaceRecord, align 8
  %8 = alloca %"struct.glm::vec", align 8
  %9 = alloca %struct.FaceRecord, align 8
  %10 = alloca %"struct.glm::vec.137", align 4
  %11 = alloca %"struct.glm::mat", align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %0, i8 0, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 8 dereferenceable(12) %2, i64 12, i1 false), !tbaa.struct !5
  %12 = getelementptr inbounds i8, ptr %2, i64 40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %13 = tail call ptr @_ZNSt6vectorIjSaIjEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  store ptr %13, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %14 = tail call ptr @_ZNSt6vectorIjSaIjEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  store ptr %14, ptr %6, align 8
  %15 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %16 = getelementptr inbounds i8, ptr %1, i64 48
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  br label %17

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

17:                                               ; preds = %.lr.ph, %30
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %19 = load i32, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %7) #8
  %20 = zext i32 %19 to i64
  %21 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI10FaceRecordSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %20) #8
  call void @_ZN10FaceRecordC2ERKS_(ptr noundef nonnull align 8 dereferenceable(120) %7, ptr noundef nonnull align 8 dereferenceable(120) %21)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #8
  invoke void @_ZN10FaceRecordC2ERKS_(ptr noundef nonnull align 8 dereferenceable(120) %9, ptr noundef nonnull align 8 dereferenceable(120) %7)
          to label %22 unwind label %33

22:                                               ; preds = %17
  %23 = invoke { <2 x float>, float } @_ZN7Surface17ComputeFaceNormalE10FaceRecord(ptr noundef nonnull align 8 dereferenceable(152) %1, ptr noundef nonnull %9)
          to label %24 unwind label %35

24:                                               ; preds = %22
  %.fca.0.extract = extractvalue { <2 x float>, float } %23, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %23, 1
  store <2 x float> %.fca.0.extract, ptr %8, align 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZN10FaceRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %9) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  %25 = invoke noundef float @_ZN3glm3dotILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEES6_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %26 unwind label %37

26:                                               ; preds = %24
  %27 = fneg float %25
  call void @_ZN3glm3vecILi4EfLNS_9qualifierE0EEC2IffLS1_0EEERKNS0_ILi3ET_XT1_EEET0_(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef %27)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %11) #8
  invoke void @_ZN3glm12outerProductILi4ELi4EfLNS_9qualifierE0EEENS_6detail18outerProduct_traitIXT_EXT0_ET1_XT2_EE4typeERKNS_3vecIXT_ES4_XT2_EEERKNS7_IXT0_ES4_XT2_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.glm::mat") align 4 %11, ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %10)
          to label %28 unwind label %39

28:                                               ; preds = %26
  %29 = invoke noundef nonnull align 4 dereferenceable(64) ptr @_ZN3glm3matILi4ELi4EfLNS_9qualifierE0EEpLIfEERS2_RKNS0_ILi4ELi4ET_LS1_0EEE(ptr noundef nonnull align 4 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(64) %11)
          to label %30 unwind label %39

30:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  call void @_ZN10FaceRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %7) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %7) #8
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %32 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br i1 %32, label %17, label %._crit_edge

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

35:                                               ; preds = %22
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN10FaceRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %9) #8
  br label %42

37:                                               ; preds = %24
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %41

39:                                               ; preds = %28, %26
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #8
  br label %41

41:                                               ; preds = %39, %37
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  br label %42

42:                                               ; preds = %41, %35, %33
  %.pn.pn = phi { ptr, i32 } [ %.pn, %41 ], [ %36, %35 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  call void @_ZN10FaceRecordD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %7) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn.pn
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3glm3dotILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEES6_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3glm3vecILi4EfLNS_9qualifierE0EEC2IffLS1_0EEERKNS0_ILi3ET_XT1_EEET0_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), float noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm12outerProductILi4ELi4EfLNS_9qualifierE0EEENS_6detail18outerProduct_traitIXT_EXT0_ET1_XT2_EE4typeERKNS_3vecIXT_ES4_XT2_EEERKNS7_IXT0_ES4_XT2_EEE(ptr dead_on_unwind noalias writable sret(%"struct.glm::mat") align 4, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(64) ptr @_ZN3glm3matILi4ELi4EfLNS_9qualifierE0EEpLIfEERS2_RKNS0_ILi4ELi4ET_LS1_0EEE(ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { 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 #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 = { inlinehint 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 #8 = { 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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


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