; 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.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::allocator.71" = type { i8 }
%"struct.spirv_cross::SPIRType" = type { %"struct.spirv_cross::IVariant.base", i32, i32, i32, i32, i32, %"class.spirv_cross::SmallVector.92", %"class.spirv_cross::SmallVector.416", i32, i8, i8, i32, %"class.spirv_cross::SmallVector.227", %"class.spirv_cross::SmallVector.92", %"struct.spirv_cross::SPIRType::ImageType", %"class.spirv_cross::TypedID.414", %"class.spirv_cross::TypedID.414", %"class.std::unordered_set.165" }
%"struct.spirv_cross::IVariant.base" = type <{ ptr, %"class.spirv_cross::TypedID.413" }>
%"class.spirv_cross::TypedID.413" = type { i32 }
%"class.spirv_cross::SmallVector.416" = type { %"class.spirv_cross::VectorView.417", i64, %"class.spirv_cross::AlignedBuffer.418" }
%"class.spirv_cross::VectorView.417" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.418" = type { [8 x i8] }
%"class.spirv_cross::SmallVector.227" = type { %"class.spirv_cross::VectorView.228", i64, %"class.spirv_cross::AlignedBuffer.229" }
%"class.spirv_cross::VectorView.228" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.229" = type { [32 x i8] }
%"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] }
%"struct.spirv_cross::SPIRType::ImageType" = type { %"class.spirv_cross::TypedID.414", i32, i8, i8, i8, i32, i32, i32 }
%"class.spirv_cross::TypedID.414" = type { i32 }
%"class.std::unordered_set.165" = type { %"class.std::_Hashtable.166" }
%"class.std::_Hashtable.166" = 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 }
%"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 }
%"class.spirv_cross::TypedID.350" = type { i32 }
%"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.spirv_cross::TypedID.415" = type { i32 }

@.str.35 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [2 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

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

; 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
declare dso_local noundef i32 @_ZNK11spirv_cross11CompilerMSL23get_resource_array_sizeERKNS_8SPIRTypeEj(ptr noundef nonnull align 8 dereferenceable(12482), ptr noundef nonnull align 8 dereferenceable(336), i32 noundef) #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

declare noundef nonnull align 8 dereferenceable(336) ptr @_ZN11spirv_cross8Compiler22get_variable_data_typeERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(176)) #3

declare noundef zeroext i1 @_ZNK11spirv_cross8Compiler8is_arrayERKNS_8SPIRTypeE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(336)) #3

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

declare noundef zeroext i1 @_ZNK11spirv_cross8Compiler25type_is_array_of_pointersERKNS_8SPIRTypeE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(336)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11spirv_cross11CompilerMSL18type_to_array_glslB5cxx11ERKNS_8SPIRTypeEj(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(12482) %1, ptr noundef nonnull align 8 dereferenceable(336) %2, i32 noundef %3) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::allocator.71", align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %15 = load ptr, ptr %6, align 8
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = getelementptr inbounds %"struct.spirv_cross::SPIRType", ptr %16, i32 0, i32 2
  %18 = load i32, ptr %17, align 8, !tbaa !11
  switch i32 %18, label %22 [
    i32 11, label %19
    i32 21, label %19
    i32 20, label %19
  ]

19:                                               ; preds = %4, %4, %4
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN11spirv_cross12CompilerGLSL18type_to_array_glslB5cxx11ERKNS_8SPIRTypeEj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(9848) %15, ptr noundef nonnull align 8 dereferenceable(336) %20, i32 noundef %21)
  br label %66

22:                                               ; preds = %4
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = call noundef zeroext i1 @_ZNK11spirv_cross8Compiler25type_is_array_of_pointersERKNS_8SPIRTypeE(ptr noundef nonnull align 8 dereferenceable(3176) %15, ptr noundef nonnull align 8 dereferenceable(336) %23)
  br i1 %24, label %27, label %25

25:                                               ; preds = %22
  %26 = call noundef zeroext i1 @_ZNK11spirv_cross11CompilerMSL19using_builtin_arrayEv(ptr noundef nonnull align 8 dereferenceable(12482) %15)
  br i1 %26, label %27, label %60

27:                                               ; preds = %25, %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRVariableEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176) %15, i32 noundef %31)
  br label %34

33:                                               ; preds = %27
  br label %34

34:                                               ; preds = %33, %30
  %35 = phi ptr [ %32, %30 ], [ null, %33 ]
  store ptr %35, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %56

38:                                               ; preds = %34
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 8, !tbaa !39
  %42 = icmp eq i32 %41, 2
  br i1 %42, label %48, label %43

43:                                               ; preds = %38
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %44, i32 0, i32 2
  %46 = load i32, ptr %45, align 8, !tbaa !39
  %47 = icmp eq i32 %46, 12
  br i1 %47, label %48, label %56

48:                                               ; preds = %43, %38
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(336) ptr @_ZN11spirv_cross8Compiler22get_variable_data_typeERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176) %15, ptr noundef nonnull align 8 dereferenceable(176) %49)
  %51 = call noundef zeroext i1 @_ZNK11spirv_cross8Compiler8is_arrayERKNS_8SPIRTypeE(ptr noundef nonnull align 8 dereferenceable(3176) %15, ptr noundef nonnull align 8 dereferenceable(336) %50)
  br i1 %51, label %52, label %56

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = call noundef i32 @_ZNK11spirv_cross11CompilerMSL23get_resource_array_sizeERKNS_8SPIRTypeEj(ptr noundef nonnull align 8 dereferenceable(12482) %15, ptr noundef nonnull align 8 dereferenceable(336) %53, i32 noundef %54)
  store i32 %55, ptr %10, align 4, !tbaa !9
  call void @_ZN11spirv_cross4joinIJRA2_KcjS3_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 1 dereferenceable(2) @.str.68, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 1 dereferenceable(2) @.str.69)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  store i32 1, ptr %11, align 4
  br label %59

56:                                               ; preds = %48, %43, %34
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN11spirv_cross12CompilerGLSL18type_to_array_glslB5cxx11ERKNS_8SPIRTypeEj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(9848) %15, ptr noundef nonnull align 8 dereferenceable(336) %57, i32 noundef %58)
  store i32 1, ptr %11, align 4
  br label %59

59:                                               ; preds = %56, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %66

60:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef @.str.35, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %61 unwind label %62

61:                                               ; preds = %60
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #4
  br label %66

62:                                               ; preds = %60
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %13, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %14, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #4
  br label %67

66:                                               ; preds = %61, %59, %19
  ret void

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

declare void @_ZN11spirv_cross12CompilerGLSL18type_to_array_glslB5cxx11ERKNS_8SPIRTypeEj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(9848), ptr noundef nonnull align 8 dereferenceable(336), i32 noundef) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11spirv_cross4joinIJRA2_KcjS3_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 1 dereferenceable(2), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(2)) #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 = { 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_cross8SPIRTypeE", !13, i64 0, !15, i64 12, !16, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !17, i64 32, !21, i64 88, !10, i64 120, !24, i64 124, !24, i64 125, !25, i64 128, !26, i64 136, !17, i64 192, !29, i64 248, !30, i64 272, !30, i64 276, !34, i64 280}
!13 = !{!"_ZTSN11spirv_cross8IVariantE", !14, i64 8}
!14 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE0EEE", !10, i64 0}
!15 = !{!"_ZTSN3spv2OpE", !7, i64 0}
!16 = !{!"_ZTSN11spirv_cross8SPIRType8BaseTypeE", !7, i64 0}
!17 = !{!"_ZTSN11spirv_cross11SmallVectorIjLm8EEE", !18, i64 0, !19, i64 16, !20, i64 24}
!18 = !{!"_ZTSN11spirv_cross10VectorViewIjEE", !6, i64 0, !19, i64 8}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSN11spirv_cross13AlignedBufferIjLm8EEE", !7, i64 0}
!21 = !{!"_ZTSN11spirv_cross11SmallVectorIbLm8EEE", !22, i64 0, !19, i64 16, !23, i64 24}
!22 = !{!"_ZTSN11spirv_cross10VectorViewIbEE", !6, i64 0, !19, i64 8}
!23 = !{!"_ZTSN11spirv_cross13AlignedBufferIbLm8EEE", !7, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSN3spv12StorageClassE", !7, i64 0}
!26 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE1EEELm8EEE", !27, i64 0, !19, i64 16, !28, i64 24}
!27 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE1EEEEE", !6, i64 0, !19, i64 8}
!28 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE1EEELm8EEE", !7, i64 0}
!29 = !{!"_ZTSN11spirv_cross8SPIRType9ImageTypeE", !30, i64 0, !31, i64 4, !24, i64 8, !24, i64 9, !24, i64 10, !10, i64 12, !32, i64 16, !33, i64 20}
!30 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE1EEE", !10, i64 0}
!31 = !{!"_ZTSN3spv3DimE", !7, i64 0}
!32 = !{!"_ZTSN3spv11ImageFormatE", !7, i64 0}
!33 = !{!"_ZTSN3spv15AccessQualifierE", !7, i64 0}
!34 = !{!"_ZTSSt13unordered_setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashIS5_ESt8equal_toIS5_ESaIS5_EE", !35, i64 0}
!35 = !{!"_ZTSSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_SaIS5_ENSt8__detail9_IdentityESt8equal_toIS5_ESt4hashIS5_ENS7_18_Mod_range_hashingENS7_20_Default_ranged_hashENS7_20_Prime_rehash_policyENS7_17_Hashtable_traitsILb1ELb1ELb1EEEE", !6, i64 0, !19, i64 8, !36, i64 16, !19, i64 24, !37, i64 32, !6, i64 48}
!36 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!37 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !38, i64 0, !19, i64 8}
!38 = !{!"float", !7, i64 0}
!39 = !{!40, !25, i64 16}
!40 = !{!"_ZTSN11spirv_cross12SPIRVariableE", !13, i64 0, !30, i64 12, !25, i64 16, !10, i64 20, !14, i64 24, !41, i64 28, !17, i64 32, !24, i64 88, !24, i64 89, !14, i64 92, !42, i64 96, !24, i64 152, !24, i64 153, !24, i64 154, !24, i64 155, !10, i64 156, !45, i64 160, !24, i64 164, !24, i64 165, !24, i64 166, !6, i64 168}
!41 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE2EEE", !10, i64 0}
!42 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE0EEELm8EEE", !43, i64 0, !19, i64 16, !44, i64 24}
!43 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE0EEEEE", !6, i64 0, !19, i64 8}
!44 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE0EEELm8EEE", !7, i64 0}
!45 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE6EEE", !10, 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"

%"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::allocator.71" = type { i8 }

@.str.35 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [2 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

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

; 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
declare dso_local noundef i32 @_ZNK11spirv_cross11CompilerMSL23get_resource_array_sizeERKNS_8SPIRTypeEj(ptr noundef nonnull align 8 dereferenceable(12482), ptr noundef nonnull align 8 dereferenceable(336), i32 noundef) local_unnamed_addr #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) local_unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(336) ptr @_ZN11spirv_cross8Compiler22get_variable_data_typeERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #3

declare noundef zeroext i1 @_ZNK11spirv_cross8Compiler8is_arrayERKNS_8SPIRTypeE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #3

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

declare noundef zeroext i1 @_ZNK11spirv_cross8Compiler25type_is_array_of_pointersERKNS_8SPIRTypeE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11spirv_cross11CompilerMSL18type_to_array_glslB5cxx11ERKNS_8SPIRTypeEj(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(12482) %1, ptr noundef nonnull align 8 dereferenceable(336) %2, i32 noundef %3) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::allocator.71", align 1
  %7 = getelementptr inbounds i8, ptr %2, i64 16
  %8 = load i32, ptr %7, align 8, !tbaa !5
  switch i32 %8, label %10 [
    i32 11, label %9
    i32 21, label %9
    i32 20, label %9
  ]

9:                                                ; preds = %4, %4, %4
  tail call void @_ZN11spirv_cross12CompilerGLSL18type_to_array_glslB5cxx11ERKNS_8SPIRTypeEj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(9848) %1, ptr noundef nonnull align 8 dereferenceable(336) %2, i32 noundef %3)
  br label %28

10:                                               ; preds = %4
  %11 = tail call noundef zeroext i1 @_ZNK11spirv_cross8Compiler25type_is_array_of_pointersERKNS_8SPIRTypeE(ptr noundef nonnull align 8 dereferenceable(3176) %1, ptr noundef nonnull align 8 dereferenceable(336) %2)
  br i1 %11, label %14, label %12

12:                                               ; preds = %10
  %13 = tail call noundef zeroext i1 @_ZNK11spirv_cross11CompilerMSL19using_builtin_arrayEv(ptr noundef nonnull align 8 dereferenceable(12482) %1)
  br i1 %13, label %14, label %24

14:                                               ; preds = %12, %10
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %.thread, label %15

15:                                               ; preds = %14
  %16 = tail call noundef nonnull align 8 dereferenceable(176) ptr @_ZN11spirv_cross8Compiler3getINS_12SPIRVariableEEERT_j(ptr noundef nonnull align 8 dereferenceable(3176) %1, i32 noundef %3)
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %18 = load i32, ptr %17, align 8, !tbaa !37
  switch i32 %18, label %.thread [
    i32 2, label %19
    i32 12, label %19
  ]

19:                                               ; preds = %15, %15
  %20 = tail call noundef nonnull align 8 dereferenceable(336) ptr @_ZN11spirv_cross8Compiler22get_variable_data_typeERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176) %1, ptr noundef nonnull align 8 dereferenceable(176) %16)
  %21 = tail call noundef zeroext i1 @_ZNK11spirv_cross8Compiler8is_arrayERKNS_8SPIRTypeE(ptr noundef nonnull align 8 dereferenceable(3176) %1, ptr noundef nonnull align 8 dereferenceable(336) %20)
  br i1 %21, label %22, label %.thread

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %23 = tail call noundef i32 @_ZNK11spirv_cross11CompilerMSL23get_resource_array_sizeERKNS_8SPIRTypeEj(ptr noundef nonnull align 8 dereferenceable(12482) %1, ptr noundef nonnull align 8 dereferenceable(336) %2, i32 noundef %3)
  store i32 %23, ptr %5, align 4, !tbaa !44
  call void @_ZN11spirv_cross4joinIJRA2_KcjS3_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 1 dereferenceable(2) @.str.68, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(2) @.str.69)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %28

.thread:                                          ; preds = %14, %15, %19
  tail call void @_ZN11spirv_cross12CompilerGLSL18type_to_array_glslB5cxx11ERKNS_8SPIRTypeEj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(9848) %1, ptr noundef nonnull align 8 dereferenceable(336) %2, i32 noundef %3)
  br label %28

24:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.35, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %25 unwind label %26

25:                                               ; preds = %24
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #4
  br label %28

26:                                               ; preds = %24
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #4
  resume { ptr, i32 } %27

28:                                               ; preds = %22, %.thread, %25, %9
  ret void
}

declare void @_ZN11spirv_cross12CompilerGLSL18type_to_array_glslB5cxx11ERKNS_8SPIRTypeEj(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(9848), ptr noundef nonnull align 8 dereferenceable(336), i32 noundef) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11spirv_cross4joinIJRA2_KcjS3_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 1 dereferenceable(2), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(2)) local_unnamed_addr #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 = { 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, !13, i64 16}
!6 = !{!"_ZTSN11spirv_cross8SPIRTypeE", !7, i64 0, !12, i64 12, !13, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !14, i64 32, !19, i64 88, !9, i64 120, !22, i64 124, !22, i64 125, !23, i64 128, !24, i64 136, !14, i64 192, !27, i64 248, !28, i64 272, !28, i64 276, !32, i64 280}
!7 = !{!"_ZTSN11spirv_cross8IVariantE", !8, i64 8}
!8 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE0EEE", !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN3spv2OpE", !10, i64 0}
!13 = !{!"_ZTSN11spirv_cross8SPIRType8BaseTypeE", !10, i64 0}
!14 = !{!"_ZTSN11spirv_cross11SmallVectorIjLm8EEE", !15, i64 0, !17, i64 16, !18, i64 24}
!15 = !{!"_ZTSN11spirv_cross10VectorViewIjEE", !16, i64 0, !17, i64 8}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{!"long", !10, i64 0}
!18 = !{!"_ZTSN11spirv_cross13AlignedBufferIjLm8EEE", !10, i64 0}
!19 = !{!"_ZTSN11spirv_cross11SmallVectorIbLm8EEE", !20, i64 0, !17, i64 16, !21, i64 24}
!20 = !{!"_ZTSN11spirv_cross10VectorViewIbEE", !16, i64 0, !17, i64 8}
!21 = !{!"_ZTSN11spirv_cross13AlignedBufferIbLm8EEE", !10, i64 0}
!22 = !{!"bool", !10, i64 0}
!23 = !{!"_ZTSN3spv12StorageClassE", !10, i64 0}
!24 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE1EEELm8EEE", !25, i64 0, !17, i64 16, !26, i64 24}
!25 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE1EEEEE", !16, i64 0, !17, i64 8}
!26 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE1EEELm8EEE", !10, i64 0}
!27 = !{!"_ZTSN11spirv_cross8SPIRType9ImageTypeE", !28, i64 0, !29, i64 4, !22, i64 8, !22, i64 9, !22, i64 10, !9, i64 12, !30, i64 16, !31, i64 20}
!28 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE1EEE", !9, i64 0}
!29 = !{!"_ZTSN3spv3DimE", !10, i64 0}
!30 = !{!"_ZTSN3spv11ImageFormatE", !10, i64 0}
!31 = !{!"_ZTSN3spv15AccessQualifierE", !10, i64 0}
!32 = !{!"_ZTSSt13unordered_setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashIS5_ESt8equal_toIS5_ESaIS5_EE", !33, i64 0}
!33 = !{!"_ZTSSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_SaIS5_ENSt8__detail9_IdentityESt8equal_toIS5_ESt4hashIS5_ENS7_18_Mod_range_hashingENS7_20_Default_ranged_hashENS7_20_Prime_rehash_policyENS7_17_Hashtable_traitsILb1ELb1ELb1EEEE", !16, i64 0, !17, i64 8, !34, i64 16, !17, i64 24, !35, i64 32, !16, i64 48}
!34 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !16, i64 0}
!35 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !36, i64 0, !17, i64 8}
!36 = !{!"float", !10, i64 0}
!37 = !{!38, !23, i64 16}
!38 = !{!"_ZTSN11spirv_cross12SPIRVariableE", !7, i64 0, !28, i64 12, !23, i64 16, !9, i64 20, !8, i64 24, !39, i64 28, !14, i64 32, !22, i64 88, !22, i64 89, !8, i64 92, !40, i64 96, !22, i64 152, !22, i64 153, !22, i64 154, !22, i64 155, !9, i64 156, !43, i64 160, !22, i64 164, !22, i64 165, !22, i64 166, !16, i64 168}
!39 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE2EEE", !9, i64 0}
!40 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE0EEELm8EEE", !41, i64 0, !17, i64 16, !42, i64 24}
!41 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE0EEEEE", !16, i64 0, !17, i64 8}
!42 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE0EEELm8EEE", !10, i64 0}
!43 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE6EEE", !9, i64 0}
!44 = !{!9, !9, i64 0}


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