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

; 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::SPIRExpression" = type <{ %"struct.spirv_cross::IVariant.base", %"class.spirv_cross::TypedID.162", %"class.std::__cxx11::basic_string", %"class.spirv_cross::TypedID.163", %"class.spirv_cross::TypedID.162", i8, i8, i8, i8, [4 x i8], %"class.spirv_cross::SmallVector.7", %"class.spirv_cross::SmallVector.7", %"class.spirv_cross::SmallVector.7", i32, [4 x i8] }>
%"struct.spirv_cross::IVariant.base" = type <{ ptr, %"class.spirv_cross::TypedID.162" }>
%"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::TypedID.163" = type { i32 }
%"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] }
%"struct.spirv_cross::SPIRAccessChain" = type { %"struct.spirv_cross::IVariant.base", %"class.spirv_cross::TypedID.163", i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, %"class.spirv_cross::TypedID.164", i32, i32, i8, i8, %"class.spirv_cross::SmallVector.7" }
%"class.spirv_cross::TypedID.164" = type { i32 }
%"struct.spirv_cross::SPIRType" = type { %"struct.spirv_cross::IVariant.base", i32, i32, i32, i32, i32, %"class.spirv_cross::SmallVector.92", %"class.spirv_cross::SmallVector.166", i32, i8, i8, i32, %"class.spirv_cross::SmallVector.169", %"class.spirv_cross::SmallVector.92", %"struct.spirv_cross::SPIRType::ImageType", %"class.spirv_cross::TypedID.163", %"class.spirv_cross::TypedID.163", %"class.std::unordered_set.172" }
%"class.spirv_cross::SmallVector.166" = type { %"class.spirv_cross::VectorView.167", i64, %"class.spirv_cross::AlignedBuffer.168" }
%"class.spirv_cross::VectorView.167" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.168" = type { [8 x i8] }
%"class.spirv_cross::SmallVector.169" = type { %"class.spirv_cross::VectorView.170", i64, %"class.spirv_cross::AlignedBuffer.171" }
%"class.spirv_cross::VectorView.170" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.171" = 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.163", i32, i8, i8, i8, i32, i32, i32 }
%"class.std::unordered_set.172" = type { %"class.std::_Hashtable.173" }
%"class.std::_Hashtable.173" = 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.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 }
%"class.spirv_cross::TypedID.165" = type { i32 }
%"struct.spirv_cross::SPIRFunction::Parameter" = type <{ %"class.spirv_cross::TypedID.163", %"class.spirv_cross::TypedID.162", i32, i32, i8, [3 x i8] }>

; 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 zeroext i1 @_ZN11spirv_cross8Compiler27variable_storage_is_aliasedERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(176)) #1 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11spirv_cross8Compiler14register_writeEj(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %11 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %12 = load i32, ptr %4, align 4, !tbaa !9
  %13 = call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %11, i32 noundef %12)
  store ptr %13, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %47, label %16

16:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_14SPIRExpressionEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %11, 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 %31

21:                                               ; preds = %16
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.spirv_cross::SPIRExpression", ptr %22, i32 0, i32 4
  %24 = call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %23)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %31

26:                                               ; preds = %21
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.spirv_cross::SPIRExpression", ptr %27, i32 0, i32 4
  %29 = call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %11, i32 noundef %29)
  store ptr %30, ptr %5, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %26, %21, %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %32 = load i32, ptr %4, align 4, !tbaa !9
  %33 = call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_15SPIRAccessChainEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %11, i32 noundef %32)
  store ptr %33, ptr %7, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %46

36:                                               ; preds = %31
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.spirv_cross::SPIRAccessChain", ptr %37, i32 0, i32 6
  %39 = call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE2EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %38)
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %46

41:                                               ; preds = %36
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.spirv_cross::SPIRAccessChain", ptr %42, i32 0, i32 6
  %44 = call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE2EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %43)
  %45 = call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %11, i32 noundef %44)
  store ptr %45, ptr %5, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %41, %36, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %47

47:                                               ; preds = %46, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %48 = load i32, ptr %4, align 4, !tbaa !9
  %49 = call noundef nonnull align 8 dereferenceable(336) ptr @_ZNK11spirv_cross8Compiler15expression_typeEj(ptr noundef nonnull align 8 dereferenceable(3176) %11, i32 noundef %48)
  store ptr %49, ptr %8, align 8, !tbaa !5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %105

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  store i8 1, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %53 = load i32, ptr %4, align 4, !tbaa !9
  %54 = call noundef nonnull align 8 dereferenceable(336) ptr @_ZNK11spirv_cross8Compiler15expression_typeEj(ptr noundef nonnull align 8 dereferenceable(3176) %11, i32 noundef %53)
  store ptr %54, ptr %10, align 8, !tbaa !5
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(336) ptr @_ZN11spirv_cross8Compiler22get_variable_data_typeERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176) %11, ptr noundef nonnull align 8 dereferenceable(176) %55)
  %57 = getelementptr inbounds %"struct.spirv_cross::SPIRType", ptr %56, i32 0, i32 9
  %58 = load i8, ptr %57, align 4, !tbaa !13, !range !40, !noundef !41
  %59 = trunc i8 %58 to i1
  br i1 %59, label %60, label %67

60:                                               ; preds = %52
  call void @_ZN11spirv_cross8Compiler26flush_all_active_variablesEv(ptr noundef nonnull align 8 dereferenceable(3176) %11)
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.spirv_cross::SPIRType", ptr %61, i32 0, i32 8
  %63 = load i32, ptr %62, align 8, !tbaa !42
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %66

65:                                               ; preds = %60
  store i8 0, ptr %9, align 1, !tbaa !11
  br label %66

66:                                               ; preds = %65, %60
  br label %67

67:                                               ; preds = %66, %52
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.spirv_cross::SPIRType", ptr %68, i32 0, i32 11
  %70 = load i32, ptr %69, align 8, !tbaa !43
  %71 = icmp eq i32 %70, 5349
  br i1 %71, label %75, label %72

72:                                               ; preds = %67
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = call noundef zeroext i1 @_ZN11spirv_cross8Compiler27variable_storage_is_aliasedERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176) %11, ptr noundef nonnull align 8 dereferenceable(176) %73)
  br i1 %74, label %75, label %76

75:                                               ; preds = %72, %67
  call void @_ZN11spirv_cross8Compiler27flush_all_aliased_variablesEv(ptr noundef nonnull align 8 dereferenceable(3176) %11)
  br label %82

76:                                               ; preds = %72
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = icmp ne ptr %77, null
  br i1 %78, label %79, label %81

79:                                               ; preds = %76
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN11spirv_cross8Compiler15flush_dependeesERNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176) %11, ptr noundef nonnull align 8 dereferenceable(176) %80)
  br label %81

81:                                               ; preds = %79, %76
  br label %82

82:                                               ; preds = %81, %75
  %83 = load i8, ptr %9, align 1, !tbaa !11, !range !40, !noundef !41
  %84 = trunc i8 %83 to i1
  br i1 %84, label %85, label %104

85:                                               ; preds = %82
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %86, i32 0, i32 20
  %88 = load ptr, ptr %87, align 8, !tbaa !44
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %104

90:                                               ; preds = %85
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %91, i32 0, i32 20
  %93 = load ptr, ptr %92, align 8, !tbaa !44
  %94 = getelementptr inbounds %"struct.spirv_cross::SPIRFunction::Parameter", ptr %93, i32 0, i32 3
  %95 = load i32, ptr %94, align 4, !tbaa !51
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %104

97:                                               ; preds = %90
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.spirv_cross::SPIRVariable", ptr %98, i32 0, i32 20
  %100 = load ptr, ptr %99, align 8, !tbaa !44
  %101 = getelementptr inbounds %"struct.spirv_cross::SPIRFunction::Parameter", ptr %100, i32 0, i32 3
  %102 = load i32, ptr %101, align 4, !tbaa !51
  %103 = add i32 %102, 1
  store i32 %103, ptr %101, align 4, !tbaa !51
  call void @_ZN11spirv_cross8Compiler15force_recompileEv(ptr noundef nonnull align 8 dereferenceable(3176) %11)
  br label %104

104:                                              ; preds = %97, %90, %85, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  br label %112

105:                                              ; preds = %47
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.spirv_cross::SPIRType", ptr %106, i32 0, i32 9
  %108 = load i8, ptr %107, align 4, !tbaa !13, !range !40, !noundef !41
  %109 = trunc i8 %108 to i1
  br i1 %109, label %110, label %111

110:                                              ; preds = %105
  call void @_ZN11spirv_cross8Compiler26flush_all_active_variablesEv(ptr noundef nonnull align 8 dereferenceable(3176) %11)
  br label %111

111:                                              ; preds = %110, %105
  br label %112

112:                                              ; preds = %111, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local 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)) #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11spirv_cross8Compiler15force_recompileEv(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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !12, i64 124}
!14 = !{!"_ZTSN11spirv_cross8SPIRTypeE", !15, i64 0, !17, i64 12, !18, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !19, i64 32, !23, i64 88, !10, i64 120, !12, i64 124, !12, i64 125, !26, i64 128, !27, i64 136, !19, i64 192, !30, i64 248, !31, i64 272, !31, i64 276, !35, i64 280}
!15 = !{!"_ZTSN11spirv_cross8IVariantE", !16, i64 8}
!16 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE0EEE", !10, i64 0}
!17 = !{!"_ZTSN3spv2OpE", !7, i64 0}
!18 = !{!"_ZTSN11spirv_cross8SPIRType8BaseTypeE", !7, i64 0}
!19 = !{!"_ZTSN11spirv_cross11SmallVectorIjLm8EEE", !20, i64 0, !21, i64 16, !22, i64 24}
!20 = !{!"_ZTSN11spirv_cross10VectorViewIjEE", !6, i64 0, !21, i64 8}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN11spirv_cross13AlignedBufferIjLm8EEE", !7, i64 0}
!23 = !{!"_ZTSN11spirv_cross11SmallVectorIbLm8EEE", !24, i64 0, !21, i64 16, !25, i64 24}
!24 = !{!"_ZTSN11spirv_cross10VectorViewIbEE", !6, i64 0, !21, i64 8}
!25 = !{!"_ZTSN11spirv_cross13AlignedBufferIbLm8EEE", !7, i64 0}
!26 = !{!"_ZTSN3spv12StorageClassE", !7, i64 0}
!27 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE1EEELm8EEE", !28, i64 0, !21, i64 16, !29, i64 24}
!28 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE1EEEEE", !6, i64 0, !21, i64 8}
!29 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE1EEELm8EEE", !7, i64 0}
!30 = !{!"_ZTSN11spirv_cross8SPIRType9ImageTypeE", !31, i64 0, !32, i64 4, !12, i64 8, !12, i64 9, !12, i64 10, !10, i64 12, !33, i64 16, !34, i64 20}
!31 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE1EEE", !10, i64 0}
!32 = !{!"_ZTSN3spv3DimE", !7, i64 0}
!33 = !{!"_ZTSN3spv11ImageFormatE", !7, i64 0}
!34 = !{!"_ZTSN3spv15AccessQualifierE", !7, i64 0}
!35 = !{!"_ZTSSt13unordered_setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashIS5_ESt8equal_toIS5_ESaIS5_EE", !36, i64 0}
!36 = !{!"_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, !21, i64 8, !37, i64 16, !21, i64 24, !38, i64 32, !6, i64 48}
!37 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!38 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !39, i64 0, !21, i64 8}
!39 = !{!"float", !7, i64 0}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = !{!14, !10, i64 120}
!43 = !{!14, !26, i64 128}
!44 = !{!45, !6, i64 168}
!45 = !{!"_ZTSN11spirv_cross12SPIRVariableE", !15, i64 0, !31, i64 12, !26, i64 16, !10, i64 20, !16, i64 24, !46, i64 28, !19, i64 32, !12, i64 88, !12, i64 89, !16, i64 92, !47, i64 96, !12, i64 152, !12, i64 153, !12, i64 154, !12, i64 155, !10, i64 156, !50, i64 160, !12, i64 164, !12, i64 165, !12, i64 166, !6, i64 168}
!46 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE2EEE", !10, i64 0}
!47 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE0EEELm8EEE", !48, i64 0, !21, i64 16, !49, i64 24}
!48 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE0EEEEE", !6, i64 0, !21, i64 8}
!49 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE0EEELm8EEE", !7, i64 0}
!50 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE6EEE", !10, i64 0}
!51 = !{!52, !10, i64 12}
!52 = !{!"_ZTSN11spirv_cross12SPIRFunction9ParameterE", !31, i64 0, !16, i64 4, !10, i64 8, !10, i64 12, !12, i64 16}


; 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 zeroext i1 @_ZN11spirv_cross8Compiler27variable_storage_is_aliasedERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(336) ptr @_ZNK11spirv_cross8Compiler15expression_typeEj(ptr noundef nonnull align 8 dereferenceable(3176), i32 noundef) local_unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11spirv_cross8Compiler14register_writeEj(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %1) local_unnamed_addr #0 align 2 {
  %3 = tail call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %1)
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %5, label %.thread

.thread:                                          ; preds = %2
  %4 = tail call noundef nonnull align 8 dereferenceable(336) ptr @_ZNK11spirv_cross8Compiler15expression_typeEj(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %1)
  br label %23

5:                                                ; preds = %2
  %6 = tail call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_14SPIRExpressionEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %1)
  %.not31 = icmp eq ptr %6, null
  br i1 %.not31, label %13, label %7

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %6, i64 52
  %9 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
  %.not32 = icmp eq i32 %9, 0
  br i1 %.not32, label %13, label %10

10:                                               ; preds = %7
  %11 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
  %12 = tail call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %11)
  br label %13

13:                                               ; preds = %10, %7, %5
  %.0 = phi ptr [ %12, %10 ], [ null, %7 ], [ null, %5 ]
  %14 = tail call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_15SPIRAccessChainEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %1)
  %.not33 = icmp eq ptr %14, null
  br i1 %.not33, label %21, label %15

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %14, i64 92
  %17 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE2EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %16)
  %.not34 = icmp eq i32 %17, 0
  br i1 %.not34, label %21, label %18

18:                                               ; preds = %15
  %19 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE2EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %16)
  %20 = tail call noundef ptr @_ZN11spirv_cross8Compiler9maybe_getINS_12SPIRVariableEEEPT_j(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %19)
  br label %21

21:                                               ; preds = %13, %15, %18
  %.2 = phi ptr [ %20, %18 ], [ %.0, %15 ], [ %.0, %13 ]
  %22 = tail call noundef nonnull align 8 dereferenceable(336) ptr @_ZNK11spirv_cross8Compiler15expression_typeEj(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %1)
  %.not35 = icmp eq ptr %.2, null
  br i1 %.not35, label %50, label %23

23:                                               ; preds = %.thread, %21
  %.239 = phi ptr [ %3, %.thread ], [ %.2, %21 ]
  %24 = tail call noundef nonnull align 8 dereferenceable(336) ptr @_ZNK11spirv_cross8Compiler15expression_typeEj(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %1)
  %25 = tail call noundef nonnull align 8 dereferenceable(336) ptr @_ZN11spirv_cross8Compiler22get_variable_data_typeERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176) %0, ptr noundef nonnull align 8 dereferenceable(176) %.239)
  %26 = getelementptr inbounds i8, ptr %25, i64 124
  %27 = load i8, ptr %26, align 4, !tbaa !5, !range !37, !noundef !38
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %29, label %33

29:                                               ; preds = %23
  tail call void @_ZN11spirv_cross8Compiler26flush_all_active_variablesEv(ptr noundef nonnull align 8 dereferenceable(3176) %0)
  %30 = getelementptr inbounds i8, ptr %24, i64 120
  %31 = load i32, ptr %30, align 8, !tbaa !39
  %32 = icmp ne i32 %31, 1
  br label %33

33:                                               ; preds = %29, %23
  %.024 = phi i1 [ true, %23 ], [ %32, %29 ]
  %34 = getelementptr inbounds i8, ptr %24, i64 128
  %35 = load i32, ptr %34, align 8, !tbaa !40
  %36 = icmp eq i32 %35, 5349
  br i1 %36, label %39, label %37

37:                                               ; preds = %33
  %38 = tail call noundef zeroext i1 @_ZN11spirv_cross8Compiler27variable_storage_is_aliasedERKNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176) %0, ptr noundef nonnull align 8 dereferenceable(176) %.239)
  br i1 %38, label %39, label %40

39:                                               ; preds = %37, %33
  tail call void @_ZN11spirv_cross8Compiler27flush_all_aliased_variablesEv(ptr noundef nonnull align 8 dereferenceable(3176) %0)
  br label %41

40:                                               ; preds = %37
  tail call void @_ZN11spirv_cross8Compiler15flush_dependeesERNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176) %0, ptr noundef nonnull align 8 dereferenceable(176) %.239)
  br label %41

41:                                               ; preds = %40, %39
  br i1 %.024, label %42, label %55

42:                                               ; preds = %41
  %43 = getelementptr inbounds i8, ptr %.239, i64 168
  %44 = load ptr, ptr %43, align 8, !tbaa !41
  %.not36 = icmp eq ptr %44, null
  br i1 %.not36, label %55, label %45

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %44, i64 12
  %47 = load i32, ptr %46, align 4, !tbaa !48
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %55

49:                                               ; preds = %45
  store i32 1, ptr %46, align 4, !tbaa !48
  tail call void @_ZN11spirv_cross8Compiler15force_recompileEv(ptr noundef nonnull align 8 dereferenceable(3176) %0)
  br label %55

50:                                               ; preds = %21
  %51 = getelementptr inbounds i8, ptr %22, i64 124
  %52 = load i8, ptr %51, align 4, !tbaa !5, !range !37, !noundef !38
  %53 = trunc nuw i8 %52 to i1
  br i1 %53, label %54, label %55

54:                                               ; preds = %50
  tail call void @_ZN11spirv_cross8Compiler26flush_all_active_variablesEv(ptr noundef nonnull align 8 dereferenceable(3176) %0)
  br label %55

55:                                               ; preds = %41, %42, %45, %49, %50, %54
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local 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 #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11spirv_cross8Compiler26flush_all_active_variablesEv(ptr noundef nonnull align 8 dereferenceable(3176)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11spirv_cross8Compiler27flush_all_aliased_variablesEv(ptr noundef nonnull align 8 dereferenceable(3176)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11spirv_cross8Compiler15flush_dependeesERNS_12SPIRVariableE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11spirv_cross8Compiler15force_recompileEv(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, !22, i64 124}
!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 = !{i8 0, i8 2}
!38 = !{}
!39 = !{!6, !9, i64 120}
!40 = !{!6, !23, i64 128}
!41 = !{!42, !16, i64 168}
!42 = !{!"_ZTSN11spirv_cross12SPIRVariableE", !7, i64 0, !28, i64 12, !23, i64 16, !9, i64 20, !8, i64 24, !43, i64 28, !14, i64 32, !22, i64 88, !22, i64 89, !8, i64 92, !44, i64 96, !22, i64 152, !22, i64 153, !22, i64 154, !22, i64 155, !9, i64 156, !47, i64 160, !22, i64 164, !22, i64 165, !22, i64 166, !16, i64 168}
!43 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE2EEE", !9, i64 0}
!44 = !{!"_ZTSN11spirv_cross11SmallVectorINS_7TypedIDILNS_5TypesE0EEELm8EEE", !45, i64 0, !17, i64 16, !46, i64 24}
!45 = !{!"_ZTSN11spirv_cross10VectorViewINS_7TypedIDILNS_5TypesE0EEEEE", !16, i64 0, !17, i64 8}
!46 = !{!"_ZTSN11spirv_cross13AlignedBufferINS_7TypedIDILNS_5TypesE0EEELm8EEE", !10, i64 0}
!47 = !{!"_ZTSN11spirv_cross7TypedIDILNS_5TypesE6EEE", !9, i64 0}
!48 = !{!49, !9, i64 12}
!49 = !{!"_ZTSN11spirv_cross12SPIRFunction9ParameterE", !28, i64 0, !8, i64 4, !9, i64 8, !9, i64 12, !22, i64 16}


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