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

; 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::TypedID.350" = type { i32 }
%"class.spirv_cross::Compiler" = type { ptr, %"class.spirv_cross::ParsedIR", %"class.spirv_cross::SmallVector.92", %"class.spirv_cross::SmallVector.92", ptr, ptr, i32, %"class.std::unordered_set.95", i8, %"class.std::unordered_set", i8, i8, %"class.spirv_cross::SmallVector.114", %"class.spirv_cross::SmallVector.92", %"class.std::function", %"class.std::unordered_set", %"class.std::unordered_set", %"class.std::unordered_set", %"class.std::unordered_set", %"class.std::unordered_set", %"class.spirv_cross::Bitset", %"class.spirv_cross::Bitset", i32, i32, i8, %"class.std::unordered_set", i8, i8, i32, %"class.std::unordered_map.117", %"class.spirv_cross::SmallVector.92", %"class.std::unordered_map.131", %"class.std::unordered_set", i8, %"class.std::unordered_map.145" }
%"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.std::unordered_set.95" = type { %"class.std::_Hashtable.96" }
%"class.std::_Hashtable.96" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.spirv_cross::SmallVector.114" = type { %"class.spirv_cross::VectorView.115", i64, %"class.spirv_cross::AlignedBuffer.116" }
%"class.spirv_cross::VectorView.115" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.116" = type { [96 x i8] }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.spirv_cross::Bitset" = type { i64, %"class.std::unordered_set" }
%"class.std::unordered_map.117" = type { %"class.std::_Hashtable.118" }
%"class.std::_Hashtable.118" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.spirv_cross::SmallVector.92" = type { %"class.spirv_cross::VectorView.93", i64, %"class.spirv_cross::AlignedBuffer.94" }
%"class.spirv_cross::VectorView.93" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.94" = type { [32 x i8] }
%"class.std::unordered_map.131" = type { %"class.std::_Hashtable.132" }
%"class.std::_Hashtable.132" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"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 }
%"class.std::unordered_map.145" = type { %"class.std::_Hashtable.146" }
%"class.std::_Hashtable.146" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.spirv_cross::SPIRVariable" = type { %"struct.spirv_cross::IVariant.base", %"class.spirv_cross::TypedID.414", i32, i32, %"class.spirv_cross::TypedID.413", %"class.spirv_cross::TypedID.350", %"class.spirv_cross::SmallVector.92", i8, i8, %"class.spirv_cross::TypedID.413", %"class.spirv_cross::SmallVector.7", i8, i8, i8, i8, i32, %"class.spirv_cross::TypedID.415", i8, i8, i8, ptr }
%"struct.spirv_cross::IVariant.base" = type <{ ptr, %"class.spirv_cross::TypedID.413" }>
%"class.spirv_cross::TypedID.414" = type { i32 }
%"class.spirv_cross::TypedID.413" = type { i32 }
%"class.spirv_cross::TypedID.415" = type { i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11spirv_cross7TypedIDILNS_5TypesE2EEC2Ej(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #0 align 2

; 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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(176) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRVariableEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176), i32 noundef) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11spirv_cross11CompilerMSL25localize_global_variablesEv(ptr noundef nonnull align 8 dereferenceable(12482) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %"class.spirv_cross::TypedID.350", align 4
  %8 = alloca %"class.spirv_cross::TypedID.350", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %10 = getelementptr inbounds %"class.spirv_cross::Compiler", ptr %9, i32 0, i32 1
  %11 = getelementptr inbounds %"class.spirv_cross::ParsedIR", ptr %10, i32 0, i32 13
  %12 = call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE4EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  %13 = call noundef nonnull align 8 dereferenceable(795) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRFunctionEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176) %9, i32 noundef %12)
  store ptr %13, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %14 = getelementptr inbounds %"class.spirv_cross::Compiler", ptr %9, i32 0, i32 2
  %15 = call noundef ptr @_ZN11spirv_cross10VectorViewIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  store ptr %15, ptr %4, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %71, %1
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"class.spirv_cross::Compiler", ptr %9, i32 0, i32 2
  %19 = call noundef ptr @_ZN11spirv_cross10VectorViewIjE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %18) #4
  %20 = icmp ne ptr %17, %19
  br i1 %20, label %21, label %72

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %23, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRVariableEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176) %9, i32 noundef %24)
  store ptr %25, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %26, i32 0, i32 2
  %28 = load i32, ptr %27, align 8, !tbaa !11
  %29 = icmp eq i32 %28, 6
  br i1 %29, label %40, label %30

30:                                               ; preds = %21
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %31, i32 0, i32 2
  %33 = load i32, ptr %32, align 8, !tbaa !11
  %34 = icmp eq i32 %33, 4
  br i1 %34, label %40, label %35

35:                                               ; preds = %30
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %36, i32 0, i32 2
  %38 = load i32, ptr %37, align 8, !tbaa !11
  %39 = icmp eq i32 %38, 5402
  br i1 %39, label %40, label %52

40:                                               ; preds = %35, %30, %21
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = call noundef zeroext i1 @_ZNK11spirv_cross12CompilerGLSL15variable_is_lutERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(9848) %9, ptr noundef nonnull align 8 dereferenceable(176) %41)
  br i1 %42, label %48, label %43

43:                                               ; preds = %40
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE2EEC2Ej(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef %45)
  %46 = getelementptr inbounds %"class.spirv_cross::TypedID.350", ptr %7, i32 0, i32 0
  %47 = load i32, ptr %46, align 4
  call void @_ZN11spirv_cross12SPIRFunction18add_local_variableENS_7TypedIDILNS_5TypesE2EEE(ptr noundef nonnull align 8 dereferenceable(795) %44, i32 %47)
  br label %48

48:                                               ; preds = %43, %40
  %49 = getelementptr inbounds %"class.spirv_cross::Compiler", ptr %9, i32 0, i32 2
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = call noundef ptr @_ZN11spirv_cross11SmallVectorIjLm8EE5eraseEPj(ptr noundef nonnull align 8 dereferenceable(56) %49, ptr noundef %50) #4
  store ptr %51, ptr %4, align 8, !tbaa !5
  br label %71

52:                                               ; preds = %35
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %53, i32 0, i32 2
  %55 = load i32, ptr %54, align 8, !tbaa !11
  %56 = icmp eq i32 %55, 3
  br i1 %56, label %57, label %67

57:                                               ; preds = %52
  %58 = call noundef zeroext i1 @_ZNK11spirv_cross11CompilerMSL14is_mesh_shaderEv(ptr noundef nonnull align 8 dereferenceable(12482) %9)
  br i1 %58, label %59, label %67

59:                                               ; preds = %57
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE2EEC2Ej(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef %61)
  %62 = getelementptr inbounds %"class.spirv_cross::TypedID.350", ptr %8, i32 0, i32 0
  %63 = load i32, ptr %62, align 4
  call void @_ZN11spirv_cross12SPIRFunction18add_local_variableENS_7TypedIDILNS_5TypesE2EEE(ptr noundef nonnull align 8 dereferenceable(795) %60, i32 %63)
  %64 = getelementptr inbounds %"class.spirv_cross::Compiler", ptr %9, i32 0, i32 2
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = call noundef ptr @_ZN11spirv_cross11SmallVectorIjLm8EE5eraseEPj(ptr noundef nonnull align 8 dereferenceable(56) %64, ptr noundef %65) #4
  store ptr %66, ptr %4, align 8, !tbaa !5
  br label %70

67:                                               ; preds = %57, %52
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds i32, ptr %68, i32 1
  store ptr %69, ptr %4, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %67, %59
  br label %71

71:                                               ; preds = %70, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %16, !llvm.loop !27

72:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(795) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRFunctionEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176), i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE4EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

declare noundef zeroext i1 @_ZNK11spirv_cross12CompilerGLSL15variable_is_lutERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(9848), ptr noundef nonnull align 8 dereferenceable(176)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11spirv_cross12SPIRFunction18add_local_variableENS_7TypedIDILNS_5TypesE2EEE(ptr noundef nonnull align 8 dereferenceable(795), i32) #0 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !16, i64 16}
!12 = !{!"_ZTSN11spirv_cross12SPIRVariableE", !13, i64 0, !15, i64 12, !16, i64 16, !10, i64 20, !14, i64 24, !17, i64 28, !18, i64 32, !22, i64 88, !22, i64 89, !14, i64 92, !23, i64 96, !22, i64 152, !22, i64 153, !22, i64 154, !22, i64 155, !10, i64 156, !26, i64 160, !22, i64 164, !22, i64 165, !22, i64 166, !6, i64 168}
!13 = !{!"_ZTSN11spirv_cross8IVariantE", !14, i64 8}
!14 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE0EEE", !10, i64 0}
!15 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE1EEE", !10, i64 0}
!16 = !{!"_ZTSN3spv12StorageClassE", !7, i64 0}
!17 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE2EEE", !10, i64 0}
!18 = !{!"_ZTSN11spirv_cross11SmallVectorIjLm8EEE", !19, i64 0, !20, i64 16, !21, i64 24}
!19 = !{!"_ZTSN11spirv_cross10VectorViewIjEE", !6, i64 0, !20, i64 8}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSN11spirv_cross13AlignedBufferIjLm8EEE", !7, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE0EEELm8EEE", !24, i64 0, !20, i64 16, !25, i64 24}
!24 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE0EEEEE", !6, i64 0, !20, i64 8}
!25 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE0EEELm8EEE", !7, i64 0}
!26 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE6EEE", !10, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"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"

%"class.spirv_cross::TypedID.350" = type { i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11spirv_cross7TypedIDILNS_5TypesE2EEC2Ej(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK11spirv_cross11CompilerMSL14is_mesh_shaderEv(ptr noundef nonnull align 8 dereferenceable(12482)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(176) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRVariableEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176), i32 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11spirv_cross11CompilerMSL25localize_global_variablesEv(ptr noundef nonnull align 8 dereferenceable(12482) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"class.spirv_cross::TypedID.350", align 4
  %3 = alloca %"class.spirv_cross::TypedID.350", align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 1744
  %5 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE4EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %4)
  %6 = tail call noundef nonnull align 8 dereferenceable(795) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRFunctionEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %5)
  %7 = getelementptr inbounds i8, ptr %0, i64 1928
  %8 = tail call noundef ptr @_ZN11spirv_cross10VectorViewIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  %9 = tail call noundef ptr @_ZN11spirv_cross10VectorViewIjE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  %.not16 = icmp eq ptr %8, %9
  br i1 %.not16, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1, %27
  %.017 = phi ptr [ %.1, %27 ], [ %8, %1 ]
  %10 = load i32, ptr %.017, align 4, !tbaa !5
  %11 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRVariableEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %10)
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = load i32, ptr %12, align 8, !tbaa !9
  switch i32 %13, label %25 [
    i32 6, label %14
    i32 4, label %14
    i32 5402, label %14
    i32 3, label %20
  ]

14:                                               ; preds = %.lr.ph, %.lr.ph, %.lr.ph
  %15 = call noundef zeroext i1 @_ZNK11spirv_cross12CompilerGLSL15variable_is_lutERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(9848) %0, ptr noundef nonnull align 8 dereferenceable(176) %11)
  br i1 %15, label %18, label %16

16:                                               ; preds = %14
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE2EEC2Ej(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %10)
  %17 = load i32, ptr %2, align 4
  call void @_ZN11spirv_cross12SPIRFunction18add_local_variableENS_7TypedIDILNS_5TypesE2EEE(ptr noundef nonnull align 8 dereferenceable(795) %6, i32 %17)
  br label %18

18:                                               ; preds = %16, %14
  %19 = call noundef ptr @_ZN11spirv_cross11SmallVectorIjLm8EE5eraseEPj(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef nonnull %.017) #3
  br label %27

20:                                               ; preds = %.lr.ph
  %21 = call noundef zeroext i1 @_ZNK11spirv_cross11CompilerMSL14is_mesh_shaderEv(ptr noundef nonnull align 8 dereferenceable(12482) %0)
  br i1 %21, label %22, label %25

22:                                               ; preds = %20
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE2EEC2Ej(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %10)
  %23 = load i32, ptr %3, align 4
  call void @_ZN11spirv_cross12SPIRFunction18add_local_variableENS_7TypedIDILNS_5TypesE2EEE(ptr noundef nonnull align 8 dereferenceable(795) %6, i32 %23)
  %24 = call noundef ptr @_ZN11spirv_cross11SmallVectorIjLm8EE5eraseEPj(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef nonnull %.017) #3
  br label %27

25:                                               ; preds = %.lr.ph, %20
  %26 = getelementptr inbounds i8, ptr %.017, i64 4
  br label %27

27:                                               ; preds = %22, %25, %18
  %.1 = phi ptr [ %19, %18 ], [ %24, %22 ], [ %26, %25 ]
  %28 = call noundef ptr @_ZN11spirv_cross10VectorViewIjE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  %.not = icmp eq ptr %.1, %28
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !26

._crit_edge:                                      ; preds = %27, %1
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(795) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRFunctionEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE4EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

declare noundef zeroext i1 @_ZNK11spirv_cross12CompilerGLSL15variable_is_lutERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(9848), ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11spirv_cross12SPIRFunction18add_local_variableENS_7TypedIDILNS_5TypesE2EEE(ptr noundef nonnull align 8 dereferenceable(795), i32) local_unnamed_addr #0 align 2

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

attributes #0 = { 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 #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 = { "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !14, i64 16}
!10 = !{!"_ZTSN11spirv_cross12SPIRVariableE", !11, i64 0, !13, i64 12, !14, i64 16, !6, i64 20, !12, i64 24, !15, i64 28, !16, i64 32, !21, i64 88, !21, i64 89, !12, i64 92, !22, i64 96, !21, i64 152, !21, i64 153, !21, i64 154, !21, i64 155, !6, i64 156, !25, i64 160, !21, i64 164, !21, i64 165, !21, i64 166, !18, i64 168}
!11 = !{!"_ZTSN11spirv_cross8IVariantE", !12, i64 8}
!12 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE0EEE", !6, i64 0}
!13 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE1EEE", !6, i64 0}
!14 = !{!"_ZTSN3spv12StorageClassE", !7, i64 0}
!15 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE2EEE", !6, i64 0}
!16 = !{!"_ZTSN11spirv_cross11SmallVectorIjLm8EEE", !17, i64 0, !19, i64 16, !20, i64 24}
!17 = !{!"_ZTSN11spirv_cross10VectorViewIjEE", !18, i64 0, !19, i64 8}
!18 = !{!"any pointer", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSN11spirv_cross13AlignedBufferIjLm8EEE", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE0EEELm8EEE", !23, i64 0, !19, i64 16, !24, i64 24}
!23 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE0EEEEE", !18, i64 0, !19, i64 8}
!24 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE0EEELm8EEE", !7, i64 0}
!25 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE6EEE", !6, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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