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

; 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"

%"struct.spirv_cross::Compiler::AnalyzeVariableScopeAccessHandler" = type { %"struct.spirv_cross::Compiler::OpcodeHandler", ptr, ptr, %"class.std::unordered_map.301", %"class.std::unordered_map.301", %"class.std::unordered_map.194", %"class.std::unordered_map.301", %"class.std::unordered_map.301", %"class.std::unordered_set", %"class.std::unordered_map.301", ptr }
%"struct.spirv_cross::Compiler::OpcodeHandler" = type { ptr }
%"class.std::unordered_map.194" = type { %"class.std::_Hashtable.195" }
%"class.std::_Hashtable.195" = 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.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.301" = type { %"class.std::_Hashtable.302" }
%"class.std::_Hashtable.302" = 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.163", i32, i32, %"class.spirv_cross::TypedID.162", %"class.spirv_cross::TypedID.164", %"class.spirv_cross::SmallVector.92", i8, i8, %"class.spirv_cross::TypedID.162", %"class.spirv_cross::SmallVector.7", i8, i8, i8, i8, i32, %"class.spirv_cross::TypedID.165", i8, i8, i8, ptr }
%"struct.spirv_cross::IVariant.base" = type <{ ptr, %"class.spirv_cross::TypedID.162" }>
%"class.spirv_cross::TypedID.163" = type { i32 }
%"class.spirv_cross::TypedID.164" = type { i32 }
%"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.spirv_cross::TypedID.162" = 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.165" = type { i32 }

; 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 uwtable
declare dso_local noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK11spirv_cross8Compiler33AnalyzeVariableScopeAccessHandler18id_is_phi_variableEj(ptr noundef nonnull align 8 dereferenceable(424) %0, i32 noundef %1) #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %7 = load ptr, ptr %4, align 8
  %8 = load i32, ptr %5, align 4, !tbaa !9
  %9 = getelementptr inbounds %"struct.spirv_cross::Compiler::AnalyzeVariableScopeAccessHandler", ptr %7, i32 0, i32 1
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = call noundef i32 @_ZNK11spirv_cross8Compiler20get_current_id_boundEv(ptr noundef nonnull align 8 dereferenceable(3176) %10)
  %12 = icmp uge i32 %8, %11
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  br label %28

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %15 = getelementptr inbounds %"struct.spirv_cross::Compiler::AnalyzeVariableScopeAccessHandler", ptr %7, i32 0, i32 1
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %16, i32 noundef %17)
  store ptr %18, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %26

21:                                               ; preds = %14
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %22, i32 0, i32 12
  %24 = load i8, ptr %23, align 1, !tbaa !24, !range !39, !noundef !40
  %25 = trunc i8 %24 to i1
  br label %26

26:                                               ; preds = %21, %14
  %27 = phi i1 [ false, %14 ], [ %25, %21 ]
  store i1 %27, ptr %3, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %28

28:                                               ; preds = %26, %13
  %29 = load i1, ptr %3, align 1
  ret i1 %29
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11spirv_cross8Compiler20get_current_id_boundEv(ptr noundef nonnull align 8 dereferenceable(3176)) #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 = { 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, !6, i64 8}
!12 = !{!"_ZTSN11spirv_cross8Compiler33AnalyzeVariableScopeAccessHandlerE", !13, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !14, i64 80, !20, i64 136, !14, i64 192, !14, i64 248, !22, i64 304, !14, i64 360, !6, i64 416}
!13 = !{!"_ZTSN11spirv_cross8Compiler13OpcodeHandlerE"}
!14 = !{!"_ZTSSt13unordered_mapIjSt13unordered_setIjSt4hashIjESt8equal_toIjESaIjEES2_S4_SaISt4pairIKjS6_EEE", !15, i64 0}
!15 = !{!"_ZTSSt10_HashtableIjSt4pairIKjSt13unordered_setIjSt4hashIjESt8equal_toIjESaIjEEESaIS9_ENSt8__detail10_Select1stES6_S4_NSB_18_Mod_range_hashingENSB_20_Default_ranged_hashENSB_20_Prime_rehash_policyENSB_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !16, i64 8, !17, i64 16, !16, i64 24, !18, i64 32, !6, i64 48}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!18 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !19, i64 0, !16, i64 8}
!19 = !{!"float", !7, i64 0}
!20 = !{!"_ZTSSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE", !21, i64 0}
!21 = !{!"_ZTSSt10_HashtableIjSt4pairIKjjESaIS2_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !16, i64 8, !17, i64 16, !16, i64 24, !18, i64 32, !6, i64 48}
!22 = !{!"_ZTSSt13unordered_setIjSt4hashIjESt8equal_toIjESaIjEE", !23, i64 0}
!23 = !{!"_ZTSSt10_HashtableIjjSaIjENSt8__detail9_IdentityESt8equal_toIjESt4hashIjENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE", !6, i64 0, !16, i64 8, !17, i64 16, !16, i64 24, !18, i64 32, !6, i64 48}
!24 = !{!25, !34, i64 153}
!25 = !{!"_ZTSN11spirv_cross12SPIRVariableE", !26, i64 0, !28, i64 12, !29, i64 16, !10, i64 20, !27, i64 24, !30, i64 28, !31, i64 32, !34, i64 88, !34, i64 89, !27, i64 92, !35, i64 96, !34, i64 152, !34, i64 153, !34, i64 154, !34, i64 155, !10, i64 156, !38, i64 160, !34, i64 164, !34, i64 165, !34, i64 166, !6, i64 168}
!26 = !{!"_ZTSN11spirv_cross8IVariantE", !27, i64 8}
!27 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE0EEE", !10, i64 0}
!28 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE1EEE", !10, i64 0}
!29 = !{!"_ZTSN3spv12StorageClassE", !7, i64 0}
!30 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE2EEE", !10, i64 0}
!31 = !{!"_ZTSN11spirv_cross11SmallVectorIjLm8EEE", !32, i64 0, !16, i64 16, !33, i64 24}
!32 = !{!"_ZTSN11spirv_cross10VectorViewIjEE", !6, i64 0, !16, i64 8}
!33 = !{!"_ZTSN11spirv_cross13AlignedBufferIjLm8EEE", !7, i64 0}
!34 = !{!"bool", !7, i64 0}
!35 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE0EEELm8EEE", !36, i64 0, !16, i64 16, !37, i64 24}
!36 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE0EEEEE", !6, i64 0, !16, i64 8}
!37 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE0EEELm8EEE", !7, i64 0}
!38 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE6EEE", !10, i64 0}
!39 = !{i8 0, i8 2}
!40 = !{}


; 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 uwtable
declare dso_local noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK11spirv_cross8Compiler33AnalyzeVariableScopeAccessHandler18id_is_phi_variableEj(ptr nocapture noundef nonnull readonly align 8 dereferenceable(424) %0, i32 noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call noundef i32 @_ZNK11spirv_cross8Compiler20get_current_id_boundEv(ptr noundef nonnull align 8 dereferenceable(3176) %4)
  %.not = icmp ugt i32 %5, %1
  br i1 %.not, label %6, label %13

6:                                                ; preds = %2
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = tail call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %7, i32 noundef %1)
  %.not7 = icmp eq ptr %8, null
  br i1 %.not7, label %13, label %9

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %8, i64 153
  %11 = load i8, ptr %10, align 1, !tbaa !21, !range !37, !noundef !38
  %12 = trunc nuw i8 %11 to i1
  br label %13

13:                                               ; preds = %6, %9, %2
  %.0 = phi i1 [ false, %2 ], [ false, %6 ], [ %12, %9 ]
  ret i1 %.0
}

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

attributes #0 = { 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 #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" }

!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, !8, i64 8}
!6 = !{!"_ZTSN11spirv_cross8Compiler33AnalyzeVariableScopeAccessHandlerE", !7, i64 0, !8, i64 8, !8, i64 16, !11, i64 24, !11, i64 80, !17, i64 136, !11, i64 192, !11, i64 248, !19, i64 304, !11, i64 360, !8, i64 416}
!7 = !{!"_ZTSN11spirv_cross8Compiler13OpcodeHandlerE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt13unordered_mapIjSt13unordered_setIjSt4hashIjESt8equal_toIjESaIjEES2_S4_SaISt4pairIKjS6_EEE", !12, i64 0}
!12 = !{!"_ZTSSt10_HashtableIjSt4pairIKjSt13unordered_setIjSt4hashIjESt8equal_toIjESaIjEEESaIS9_ENSt8__detail10_Select1stES6_S4_NSB_18_Mod_range_hashingENSB_20_Default_ranged_hashENSB_20_Prime_rehash_policyENSB_17_Hashtable_traitsILb0ELb0ELb1EEEE", !8, i64 0, !13, i64 8, !14, i64 16, !13, i64 24, !15, i64 32, !8, i64 48}
!13 = !{!"long", !9, i64 0}
!14 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !8, i64 0}
!15 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !16, i64 0, !13, i64 8}
!16 = !{!"float", !9, i64 0}
!17 = !{!"_ZTSSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE", !18, i64 0}
!18 = !{!"_ZTSSt10_HashtableIjSt4pairIKjjESaIS2_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !8, i64 0, !13, i64 8, !14, i64 16, !13, i64 24, !15, i64 32, !8, i64 48}
!19 = !{!"_ZTSSt13unordered_setIjSt4hashIjESt8equal_toIjESaIjEE", !20, i64 0}
!20 = !{!"_ZTSSt10_HashtableIjjSaIjENSt8__detail9_IdentityESt8equal_toIjESt4hashIjENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE", !8, i64 0, !13, i64 8, !14, i64 16, !13, i64 24, !15, i64 32, !8, i64 48}
!21 = !{!22, !32, i64 153}
!22 = !{!"_ZTSN11spirv_cross12SPIRVariableE", !23, i64 0, !26, i64 12, !27, i64 16, !25, i64 20, !24, i64 24, !28, i64 28, !29, i64 32, !32, i64 88, !32, i64 89, !24, i64 92, !33, i64 96, !32, i64 152, !32, i64 153, !32, i64 154, !32, i64 155, !25, i64 156, !36, i64 160, !32, i64 164, !32, i64 165, !32, i64 166, !8, i64 168}
!23 = !{!"_ZTSN11spirv_cross8IVariantE", !24, i64 8}
!24 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE0EEE", !25, i64 0}
!25 = !{!"int", !9, i64 0}
!26 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE1EEE", !25, i64 0}
!27 = !{!"_ZTSN3spv12StorageClassE", !9, i64 0}
!28 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE2EEE", !25, i64 0}
!29 = !{!"_ZTSN11spirv_cross11SmallVectorIjLm8EEE", !30, i64 0, !13, i64 16, !31, i64 24}
!30 = !{!"_ZTSN11spirv_cross10VectorViewIjEE", !8, i64 0, !13, i64 8}
!31 = !{!"_ZTSN11spirv_cross13AlignedBufferIjLm8EEE", !9, i64 0}
!32 = !{!"bool", !9, i64 0}
!33 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE0EEELm8EEE", !34, i64 0, !13, i64 16, !35, i64 24}
!34 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE0EEEEE", !8, i64 0, !13, i64 8}
!35 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE0EEELm8EEE", !9, i64 0}
!36 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE6EEE", !25, i64 0}
!37 = !{i8 0, i8 2}
!38 = !{}


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