; LLVM IR from paroj/gltut :: glsdk/glmesh/source (Mesh)

; 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.glmesh::Mesh" = type { %"class.std::auto_ptr.0" }
%"class.std::auto_ptr.0" = type { ptr }
%"class.glmesh::RenderCmdList" = type { %"class.std::auto_ptr" }
%"class.std::auto_ptr" = type { ptr }
%"struct.glmesh::RenderCmdListData" = type { i8, i32, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<glmesh::(anonymous namespace)::RenderCmd, std::allocator<glmesh::(anonymous namespace)::RenderCmd>>::_Vector_impl" }
%"struct.std::_Vector_base<glmesh::(anonymous namespace)::RenderCmd, std::allocator<glmesh::(anonymous namespace)::RenderCmd>>::_Vector_impl" = type { %"struct.std::_Vector_base<glmesh::(anonymous namespace)::RenderCmd, std::allocator<glmesh::(anonymous namespace)::RenderCmd>>::_Vector_impl_data" }
%"struct.std::_Vector_base<glmesh::(anonymous namespace)::RenderCmd, std::allocator<glmesh::(anonymous namespace)::RenderCmd>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6glmesh4MeshC2ERKSt6vectorIjSaIjEEjRKNS_13RenderCmdListERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessISF_ESaISt4pairIKSF_jEEE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(48) %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %13 = load ptr, ptr %6, align 8
  %14 = getelementptr inbounds %"class.glmesh::Mesh", ptr %13, i32 0, i32 0
  %15 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #4
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.glmesh::RenderCmdList", ptr %18, i32 0, i32 0
  %20 = call noundef ptr @_ZNKSt8auto_ptrIN6glmesh17RenderCmdListDataEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  %21 = getelementptr inbounds %"struct.glmesh::RenderCmdListData", ptr %20, i32 0, i32 2
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN6glmesh8MeshDataC2ERKSt6vectorIjSaIjEEjRKS1_INS_12_GLOBAL__N_19RenderCmdESaIS7_EERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessISI_ESaISt4pairIKSI_jEEE(ptr noundef nonnull align 8 dereferenceable(104) %15, ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef %17, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(48) %22)
          to label %23 unwind label %24

23:                                               ; preds = %5
  call void @_ZNSt8auto_ptrIN6glmesh8MeshDataEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef %15) #5
  ret void

24:                                               ; preds = %5
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %11, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %15, i64 noundef 104) #6
  br label %28

28:                                               ; preds = %24
  %29 = load ptr, ptr %11, align 8
  %30 = load i32, ptr %12, align 4
  %31 = insertvalue { ptr, i32 } poison, ptr %29, 0
  %32 = insertvalue { ptr, i32 } %31, i32 %30, 1
  resume { ptr, i32 } %32
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN6glmesh8MeshDataC2ERKSt6vectorIjSaIjEEjRKS1_INS_12_GLOBAL__N_19RenderCmdESaIS7_EERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessISI_ESaISt4pairIKSI_jEEE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

attributes #0 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #4 = { builtin allocsize(0) }
attributes #5 = { nounwind }
attributes #6 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"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"

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6glmesh4MeshC2ERKSt6vectorIjSaIjEEjRKNS_13RenderCmdListERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessISF_ESaISt4pairIKSF_jEEE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(48) %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = tail call noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #4
  %7 = tail call noundef ptr @_ZNKSt8auto_ptrIN6glmesh17RenderCmdListDataEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  invoke void @_ZN6glmesh8MeshDataC2ERKSt6vectorIjSaIjEEjRKS1_INS_12_GLOBAL__N_19RenderCmdESaIS7_EERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessISI_ESaISt4pairIKSI_jEEE(ptr noundef nonnull align 8 dereferenceable(104) %6, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(48) %4)
          to label %9 unwind label %10

9:                                                ; preds = %5
  tail call void @_ZNSt8auto_ptrIN6glmesh8MeshDataEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %6) #5
  ret void

10:                                               ; preds = %5
  %11 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %6, i64 noundef 104) #6
  resume { ptr, i32 } %11
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN6glmesh8MeshDataC2ERKSt6vectorIjSaIjEEjRKS1_INS_12_GLOBAL__N_19RenderCmdESaIS7_EERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjSt4lessISI_ESaISt4pairIKSI_jEEE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

attributes #0 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #4 = { builtin allocsize(0) }
attributes #5 = { nounwind }
attributes #6 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass