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

; 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::SmallVector.313" = type { %"class.spirv_cross::VectorView.314", i64, %"class.spirv_cross::AlignedBuffer.315" }
%"class.spirv_cross::VectorView.314" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.315" = type { [40 x i8] }
%class.anon.498 = type { 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper26get_candidates_for_featureENS1_7FeatureERKNS1_6ResultE(ptr dead_on_unwind noalias writable sret(%"class.spirv_cross::SmallVector.313") align 8 %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(40) %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca %class.anon.498, align 8
  %9 = alloca %class.anon.498, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store i32 %1, ptr %5, align 4, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  store i1 false, ptr %7, align 1
  %12 = load i32, ptr %5, align 4, !tbaa !5
  call void @_ZN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper26get_candidates_for_featureENS1_7FeatureE(ptr dead_on_unwind writable sret(%"class.spirv_cross::SmallVector.313") align 8 %0, i32 noundef %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %13 = getelementptr inbounds %class.anon.498, ptr %8, i32 0, i32 0
  %14 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %14, ptr %13, align 8, !tbaa !9
  %15 = call noundef ptr @_ZN11spirv_cross10VectorViewINS_12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %0) #5
  %16 = call noundef ptr @_ZN11spirv_cross10VectorViewINS_12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateEE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %0) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !11
  %17 = getelementptr inbounds %class.anon.498, ptr %9, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8
  invoke void @"_ZSt4sortIPN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateEZNS2_26get_candidates_for_featureENS2_7FeatureERKNS2_6ResultEE3$_0EvT_SA_T0_"(ptr noundef %15, ptr noundef %16, ptr %18)
          to label %19 unwind label %21

19:                                               ; preds = %3
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %20 = load i1, ptr %7, align 1
  br i1 %20, label %26, label %25

21:                                               ; preds = %3
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %10, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @_ZN11spirv_cross11SmallVectorINS_12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateELm10EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %0) #5
  br label %27

25:                                               ; preds = %19
  call void @_ZN11spirv_cross11SmallVectorINS_12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateELm10EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %0) #5
  br label %26

26:                                               ; preds = %25, %19
  ret void

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper26get_candidates_for_featureENS1_7FeatureE(ptr dead_on_unwind noalias writable sret(%"class.spirv_cross::SmallVector.313") align 8, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateEZNS2_26get_candidates_for_featureENS2_7FeatureERKNS2_6ResultEE3$_0EvT_SA_T0_"(ptr noundef, ptr noundef, ptr) #4

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #5 = { 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 = !{!"_ZTSN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper7FeatureE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i64 0, i64 8, !9}


; 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::SmallVector.313" = type { %"class.spirv_cross::VectorView.314", i64, %"class.spirv_cross::AlignedBuffer.315" }
%"class.spirv_cross::VectorView.314" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.315" = type { [40 x i8] }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper26get_candidates_for_featureENS1_7FeatureERKNS1_6ResultE(ptr dead_on_unwind noalias writable sret(%"class.spirv_cross::SmallVector.313") align 8 %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(40) %2) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper26get_candidates_for_featureENS1_7FeatureE(ptr dead_on_unwind writable sret(%"class.spirv_cross::SmallVector.313") align 8 %0, i32 noundef %1)
  %4 = tail call noundef ptr @_ZN11spirv_cross10VectorViewINS_12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  %5 = tail call noundef ptr @_ZN11spirv_cross10VectorViewINS_12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateEE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  invoke void @"_ZSt4sortIPN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateEZNS2_26get_candidates_for_featureENS2_7FeatureERKNS2_6ResultEE3$_0EvT_SA_T0_"(ptr noundef %4, ptr noundef %5, ptr nonnull %2)
          to label %8 unwind label %6

6:                                                ; preds = %3
  %7 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN11spirv_cross11SmallVectorINS_12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateELm10EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %0) #3
  resume { ptr, i32 } %7

8:                                                ; preds = %3
  ret void
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper26get_candidates_for_featureENS1_7FeatureE(ptr dead_on_unwind noalias writable sret(%"class.spirv_cross::SmallVector.313") align 8, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPN11spirv_cross12CompilerGLSL27ShaderSubgroupSupportHelper9CandidateEZNS2_26get_candidates_for_featureENS2_7FeatureERKNS2_6ResultEE3$_0EvT_SA_T0_"(ptr noundef, ptr noundef, ptr) local_unnamed_addr #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" }
attributes #2 = { inlinehint 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 = { 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: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass