; LLVM IR from paroj/gltut :: glsdk/glutil/source/Font.ll (ZNK6glutil9GlyphQuad12GetPositionsEv)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<glm::detail::tvec2<float>, std::allocator<glm::detail::tvec2<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<glm::detail::tvec2<float>, std::allocator<glm::detail::tvec2<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<glm::detail::tvec2<float>, std::allocator<glm::detail::tvec2<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<glm::detail::tvec2<float>, std::allocator<glm::detail::tvec2<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.glm::detail::tvec2" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float }
%"class.glutil::GlyphQuad" = type { %"struct.glm::detail::tvec2", %"struct.glm::detail::tvec2", %"struct.glm::detail::tvec2", %"struct.glm::detail::tvec2" }
%struct.anon.1 = type { float, float }

; 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
define dso_local void @_ZNK6glutil9GlyphQuad12GetPositionsEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 4 dereferenceable(32) %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.glm::detail::tvec2", align 4
  %9 = alloca %"struct.glm::detail::tvec2", align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  call void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 4)
          to label %11 unwind label %33

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %12 = getelementptr inbounds %"class.glutil::GlyphQuad", ptr %10, i32 0, i32 0
  %13 = getelementptr inbounds %"struct.glm::detail::tvec2", ptr %12, i32 0, i32 0
  %14 = getelementptr inbounds %struct.anon.1, ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds %"class.glutil::GlyphQuad", ptr %10, i32 0, i32 2
  %16 = getelementptr inbounds %"struct.glm::detail::tvec2", ptr %15, i32 0, i32 0
  %17 = getelementptr inbounds %struct.anon.1, ptr %16, i32 0, i32 1
  invoke void @_ZN3glm6detail5tvec2IfEC2ERKfS4_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %18 unwind label %37

18:                                               ; preds = %11
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %19 unwind label %37

19:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %20 = getelementptr inbounds %"class.glutil::GlyphQuad", ptr %10, i32 0, i32 0
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %20)
          to label %21 unwind label %33

21:                                               ; preds = %19
  %22 = getelementptr inbounds %"class.glutil::GlyphQuad", ptr %10, i32 0, i32 2
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %23 unwind label %33

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %24 = getelementptr inbounds %"class.glutil::GlyphQuad", ptr %10, i32 0, i32 2
  %25 = getelementptr inbounds %"struct.glm::detail::tvec2", ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.anon.1, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %"class.glutil::GlyphQuad", ptr %10, i32 0, i32 0
  %28 = getelementptr inbounds %"struct.glm::detail::tvec2", ptr %27, i32 0, i32 0
  %29 = getelementptr inbounds %struct.anon.1, ptr %28, i32 0, i32 1
  invoke void @_ZN3glm6detail5tvec2IfEC2ERKfS4_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %30 unwind label %41

30:                                               ; preds = %23
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %31 unwind label %41

31:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  store i1 true, ptr %5, align 1
  %32 = load i1, ptr %5, align 1
  br i1 %32, label %46, label %45

33:                                               ; preds = %21, %19, %2
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %6, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %7, align 4
  br label %47

37:                                               ; preds = %18, %11
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %6, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %47

41:                                               ; preds = %30, %23
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %6, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %47

45:                                               ; preds = %31
  call void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %46

46:                                               ; preds = %45, %31
  ret void

47:                                               ; preds = %41, %37, %33
  call void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %6, align 8
  %50 = load i32, ptr %7, align 4
  %51 = insertvalue { ptr, i32 } poison, ptr %49, 0
  %52 = insertvalue { ptr, i32 } %51, i32 %50, 1
  resume { ptr, i32 } %52
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { 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"}


; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<glm::detail::tvec2<float>, std::allocator<glm::detail::tvec2<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<glm::detail::tvec2<float>, std::allocator<glm::detail::tvec2<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<glm::detail::tvec2<float>, std::allocator<glm::detail::tvec2<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<glm::detail::tvec2<float>, std::allocator<glm::detail::tvec2<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.glm::detail::tvec2" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float }

; 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
define dso_local void @_ZNK6glutil9GlyphQuad12GetPositionsEv(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 4 dereferenceable(32) %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.glm::detail::tvec2", align 4
  %4 = alloca %"struct.glm::detail::tvec2", align 4
  tail call void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 4)
          to label %5 unwind label %13

5:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = getelementptr inbounds i8, ptr %1, i64 20
  call void @_ZN3glm6detail5tvec2IfEC2ERKfS4_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %7)
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %3)
          to label %8 unwind label %15

8:                                                ; preds = %5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %1)
          to label %9 unwind label %13

9:                                                ; preds = %8
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %10 unwind label %13

10:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %11 = getelementptr inbounds i8, ptr %1, i64 4
  call void @_ZN3glm6detail5tvec2IfEC2ERKfS4_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %11)
  invoke void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %12 unwind label %17

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

13:                                               ; preds = %9, %8, %2
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %19

15:                                               ; preds = %5
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %19

17:                                               ; preds = %10
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %19

19:                                               ; preds = %17, %15, %13
  %.pn = phi { ptr, i32 } [ %18, %17 ], [ %14, %13 ], [ %16, %15 ]
  call void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  resume { ptr, i32 } %.pn
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3glm6detail5tvec2IfEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { 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