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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.spirv_cross::TypedID" = type { i32 }
%"struct.spirv_cross::CombinedImageSampler" = type { %"class.spirv_cross::TypedID.190", %"class.spirv_cross::TypedID.190", %"class.spirv_cross::TypedID.190" }
%"class.spirv_cross::TypedID.190" = type { i32 }

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

declare noundef zeroext i1 @_ZNK11spirv_cross8Compiler14has_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176), i32, i32 noundef) #1

declare noundef i32 @_ZNK11spirv_cross8Compiler14get_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176), i32, i32 noundef) #1

; 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
define dso_local void @_ZN16spirv_cross_util33inherit_combined_sampler_bindingsERN11spirv_cross8CompilerE(ptr noundef nonnull align 8 dereferenceable(3176) %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.spirv_cross::TypedID", align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.spirv_cross::TypedID", align 4
  %11 = alloca %"class.spirv_cross::TypedID", align 4
  %12 = alloca %"class.spirv_cross::TypedID", align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.spirv_cross::TypedID", align 4
  %15 = alloca %"class.spirv_cross::TypedID", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNK11spirv_cross8Compiler27get_combined_image_samplersEv(ptr noundef nonnull align 8 dereferenceable(3176) %16)
  store ptr %17, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %18, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call noundef ptr @_ZNK11spirv_cross10VectorViewINS_20CombinedImageSamplerEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %19) #4
  store ptr %20, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call noundef ptr @_ZNK11spirv_cross10VectorViewINS_20CombinedImageSamplerEE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %21) #4
  store ptr %22, ptr %6, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %70, %1
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = icmp ne ptr %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %73

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %29, ptr %7, align 8, !tbaa !5
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.spirv_cross::CombinedImageSampler", ptr %31, i32 0, i32 1
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %33 = getelementptr inbounds %"class.spirv_cross::TypedID", ptr %8, i32 0, i32 0
  %34 = load i32, ptr %33, align 4
  %35 = call noundef zeroext i1 @_ZNK11spirv_cross8Compiler14has_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176) %30, i32 %34, i32 noundef 34)
  br i1 %35, label %36, label %49

36:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.spirv_cross::CombinedImageSampler", ptr %38, i32 0, i32 1
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %39)
  %40 = getelementptr inbounds %"class.spirv_cross::TypedID", ptr %10, i32 0, i32 0
  %41 = load i32, ptr %40, align 4
  %42 = call noundef i32 @_ZNK11spirv_cross8Compiler14get_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176) %37, i32 %41, i32 noundef 34)
  store i32 %42, ptr %9, align 4, !tbaa !9
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.spirv_cross::CombinedImageSampler", ptr %44, i32 0, i32 0
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %45)
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = getelementptr inbounds %"class.spirv_cross::TypedID", ptr %11, i32 0, i32 0
  %48 = load i32, ptr %47, align 4
  call void @_ZN11spirv_cross8Compiler14set_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationEj(ptr noundef nonnull align 8 dereferenceable(3176) %43, i32 %48, i32 noundef 34, i32 noundef %46)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %49

49:                                               ; preds = %36, %28
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.spirv_cross::CombinedImageSampler", ptr %51, i32 0, i32 1
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %52)
  %53 = getelementptr inbounds %"class.spirv_cross::TypedID", ptr %12, i32 0, i32 0
  %54 = load i32, ptr %53, align 4
  %55 = call noundef zeroext i1 @_ZNK11spirv_cross8Compiler14has_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176) %50, i32 %54, i32 noundef 33)
  br i1 %55, label %56, label %69

56:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.spirv_cross::CombinedImageSampler", ptr %58, i32 0, i32 1
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %59)
  %60 = getelementptr inbounds %"class.spirv_cross::TypedID", ptr %14, i32 0, i32 0
  %61 = load i32, ptr %60, align 4
  %62 = call noundef i32 @_ZNK11spirv_cross8Compiler14get_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176) %57, i32 %61, i32 noundef 33)
  store i32 %62, ptr %13, align 4, !tbaa !9
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.spirv_cross::CombinedImageSampler", ptr %64, i32 0, i32 0
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %65)
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = getelementptr inbounds %"class.spirv_cross::TypedID", ptr %15, i32 0, i32 0
  %68 = load i32, ptr %67, align 4
  call void @_ZN11spirv_cross8Compiler14set_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationEj(ptr noundef nonnull align 8 dereferenceable(3176) %63, i32 %68, i32 noundef 33, i32 noundef %66)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %69

69:                                               ; preds = %56, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %70

70:                                               ; preds = %69
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.spirv_cross::CombinedImageSampler", ptr %71, i32 1
  store ptr %72, ptr %5, align 8, !tbaa !5
  br label %23

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(120) ptr @_ZNK11spirv_cross8Compiler27get_combined_image_samplersEv(ptr noundef nonnull align 8 dereferenceable(3176)) #3 align 2

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

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

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

declare void @_ZN11spirv_cross8Compiler14set_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationEj(ptr noundef nonnull align 8 dereferenceable(3176), i32, i32 noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

declare noundef zeroext i1 @_ZNK11spirv_cross8Compiler14has_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176), i32, i32 noundef) local_unnamed_addr #0

declare noundef i32 @_ZNK11spirv_cross8Compiler14get_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176), i32, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16spirv_cross_util33inherit_combined_sampler_bindingsERN11spirv_cross8CompilerE(ptr noundef nonnull align 8 dereferenceable(3176) %0) local_unnamed_addr #1 {
  %2 = alloca %"class.spirv_cross::TypedID", align 4
  %3 = alloca %"class.spirv_cross::TypedID", align 4
  %4 = alloca %"class.spirv_cross::TypedID", align 4
  %5 = alloca %"class.spirv_cross::TypedID", align 4
  %6 = alloca %"class.spirv_cross::TypedID", align 4
  %7 = alloca %"class.spirv_cross::TypedID", align 4
  %8 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNK11spirv_cross8Compiler27get_combined_image_samplersEv(ptr noundef nonnull align 8 dereferenceable(3176) %0)
  %9 = tail call noundef ptr @_ZNK11spirv_cross10VectorViewINS_20CombinedImageSamplerEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  %10 = tail call noundef ptr @_ZNK11spirv_cross10VectorViewINS_20CombinedImageSamplerEE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  %.not21 = icmp eq ptr %9, %10
  br i1 %.not21, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %25, %1
  ret void

.lr.ph:                                           ; preds = %1, %25
  %.022 = phi ptr [ %26, %25 ], [ %9, %1 ]
  %11 = getelementptr inbounds i8, ptr %.022, i64 4
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %12 = load i32, ptr %2, align 4
  %13 = call noundef zeroext i1 @_ZNK11spirv_cross8Compiler14has_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 %12, i32 noundef 34)
  br i1 %13, label %14, label %18

14:                                               ; preds = %.lr.ph
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %15 = load i32, ptr %3, align 4
  %16 = call noundef i32 @_ZNK11spirv_cross8Compiler14get_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 %15, i32 noundef 34)
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %.022)
  %17 = load i32, ptr %4, align 4
  call void @_ZN11spirv_cross8Compiler14set_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationEj(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 %17, i32 noundef 34, i32 noundef %16)
  br label %18

18:                                               ; preds = %14, %.lr.ph
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %19 = load i32, ptr %5, align 4
  %20 = call noundef zeroext i1 @_ZNK11spirv_cross8Compiler14has_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 %19, i32 noundef 33)
  br i1 %20, label %21, label %25

21:                                               ; preds = %18
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %22 = load i32, ptr %6, align 4
  %23 = call noundef i32 @_ZNK11spirv_cross8Compiler14get_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationE(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 %22, i32 noundef 33)
  call void @_ZN11spirv_cross7TypedIDILNS_5TypesE0EEC2ILS1_2EEERKNS0_IXT_EEE(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %.022)
  %24 = load i32, ptr %7, align 4
  call void @_ZN11spirv_cross8Compiler14set_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationEj(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 %24, i32 noundef 33, i32 noundef %23)
  br label %25

25:                                               ; preds = %21, %18
  %26 = getelementptr inbounds i8, ptr %.022, i64 12
  %.not = icmp eq ptr %26, %10
  br i1 %.not, label %._crit_edge, label %.lr.ph
}

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

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

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

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

declare void @_ZN11spirv_cross8Compiler14set_decorationENS_7TypedIDILNS_5TypesE0EEEN3spv10DecorationEj(ptr noundef nonnull align 8 dereferenceable(3176), i32, i32 noundef, i32 noundef) local_unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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)"}


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