; LLVM IR from Try/Tempest :: Engine/thirdparty/spirv_cross (spirv_cross_parsed_ir)

; 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.spirv_cross::ParsedIR" = type { %"class.std::unique_ptr", %"class.std::vector", %"class.spirv_cross::SmallVector", %"class.std::unordered_map", [14 x %"class.spirv_cross::SmallVector.7"], %"class.spirv_cross::SmallVector.7", %"class.spirv_cross::SmallVector.7", %"class.std::unordered_map.10", %"class.spirv_cross::SmallVector.24", %"class.spirv_cross::SmallVector.27", %"class.spirv_cross::SmallVector.30", %"class.std::unordered_map.33", %"class.std::unordered_map.52", %"class.spirv_cross::TypedID", %"struct.spirv_cross::ParsedIR::Source", i32, i32, i32, i32, %"class.std::__cxx11::basic_string", %"class.spirv_cross::Bitset", %"class.std::unordered_set" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"class.spirv_cross::SmallVector" = type { %"class.spirv_cross::VectorView", i64, %"class.spirv_cross::AlignedBuffer" }
%"class.spirv_cross::VectorView" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer" = type { [192 x i8] }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = 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.spirv_cross::SmallVector.7" = type { %"class.spirv_cross::VectorView.8", i64, %"class.spirv_cross::AlignedBuffer.9" }
%"class.spirv_cross::VectorView.8" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.9" = type { [32 x i8] }
%"class.std::unordered_map.10" = type { %"class.std::_Hashtable.11" }
%"class.std::_Hashtable.11" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.spirv_cross::SmallVector.24" = type { %"class.spirv_cross::VectorView.25", i64, %"class.spirv_cross::AlignedBuffer.26" }
%"class.spirv_cross::VectorView.25" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.26" = type { [32 x i8] }
%"class.spirv_cross::SmallVector.27" = type { %"class.spirv_cross::VectorView.28", i64, %"class.spirv_cross::AlignedBuffer.29" }
%"class.spirv_cross::VectorView.28" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.29" = type { [256 x i8] }
%"class.spirv_cross::SmallVector.30" = type { %"class.spirv_cross::VectorView.31", i64, %"class.spirv_cross::AlignedBuffer.32" }
%"class.spirv_cross::VectorView.31" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.32" = type { [8 x i8] }
%"class.std::unordered_map.33" = type { %"class.std::_Hashtable.34" }
%"class.std::_Hashtable.34" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::unordered_map.52" = type { %"class.std::_Hashtable.53" }
%"class.std::_Hashtable.53" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.spirv_cross::TypedID" = type { i32 }
%"struct.spirv_cross::ParsedIR::Source" = type <{ i32, i8, i8, i8, i8 }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.spirv_cross::Bitset" = type { i64, %"class.std::unordered_set" }
%"class.std::unordered_set" = type { %"class.std::_Hashtable.74" }
%"class.std::_Hashtable.74" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN11spirv_cross8ParsedIR13set_id_boundsEj(ptr noundef nonnull align 8 dereferenceable(1920) %0, i32 noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %"class.spirv_cross::ParsedIR", ptr %6, i32 0, i32 2
  %8 = load i32, ptr %4, align 4, !tbaa !9
  %9 = zext i32 %8 to i64
  call void @_ZN11spirv_cross11SmallVectorINS_7VariantELm8EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(216) %7, i64 noundef %9) #2
  br label %10

10:                                               ; preds = %16, %2
  %11 = getelementptr inbounds %"class.spirv_cross::ParsedIR", ptr %6, i32 0, i32 2
  %12 = call noundef i64 @_ZNK11spirv_cross10VectorViewINS_7VariantEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #2
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = zext i32 %13 to i64
  %15 = icmp ult i64 %12, %14
  br i1 %15, label %16, label %20

16:                                               ; preds = %10
  %17 = getelementptr inbounds %"class.spirv_cross::ParsedIR", ptr %6, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %18 = getelementptr inbounds %"class.spirv_cross::ParsedIR", ptr %6, i32 0, i32 0
  %19 = call noundef ptr @_ZNKSt10unique_ptrIN11spirv_cross15ObjectPoolGroupESt14default_deleteIS1_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #2
  store ptr %19, ptr %5, align 8, !tbaa !5
  call void @_ZN11spirv_cross11SmallVectorINS_7VariantELm8EE12emplace_backIJPNS_15ObjectPoolGroupEEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(216) %17, ptr noundef nonnull align 8 dereferenceable(8) %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  br label %10, !llvm.loop !11

20:                                               ; preds = %10
  %21 = getelementptr inbounds %"class.spirv_cross::ParsedIR", ptr %6, i32 0, i32 10
  %22 = load i32, ptr %4, align 4, !tbaa !9
  %23 = zext i32 %22 to i64
  call void @_ZN11spirv_cross11SmallVectorIhLm8EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(32) %21, i64 noundef %23) #2
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN11spirv_cross8ParsedIR13set_id_boundsEj(ptr noundef nonnull align 8 dereferenceable(1920) %0, i32 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = zext i32 %1 to i64
  tail call void @_ZN11spirv_cross11SmallVectorINS_7VariantELm8EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(216) %4, i64 noundef %5) #2
  %6 = tail call noundef i64 @_ZNK11spirv_cross10VectorViewINS_7VariantEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #2
  %7 = icmp ult i64 %6, %5
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #2
  %8 = call noundef ptr @_ZNKSt10unique_ptrIN11spirv_cross15ObjectPoolGroupESt14default_deleteIS1_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #2
  store ptr %8, ptr %3, align 8, !tbaa !5
  call void @_ZN11spirv_cross11SmallVectorINS_7VariantELm8EE12emplace_backIJPNS_15ObjectPoolGroupEEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(216) %4, ptr noundef nonnull align 8 dereferenceable(8) %3) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #2
  %9 = call noundef i64 @_ZNK11spirv_cross10VectorViewINS_7VariantEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #2
  %10 = icmp ult i64 %9, %5
  br i1 %10, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %2
  %11 = getelementptr inbounds i8, ptr %0, i64 1592
  call void @_ZN11spirv_cross11SmallVectorIhLm8EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %5) #2
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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