; 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::IVariant" = type <{ ptr, %"class.spirv_cross::TypedID.162", [4 x i8] }>
%"class.spirv_cross::TypedID.162" = type { i32 }
%"struct.spirv_cross::SPIRBlock" = type { %"struct.spirv_cross::IVariant.base", i32, i32, i32, %"class.spirv_cross::TypedID.165", %"class.spirv_cross::TypedID.165", %"class.spirv_cross::TypedID.165", %"class.spirv_cross::TypedID.162", %"class.spirv_cross::TypedID.162", %"class.spirv_cross::TypedID.165", %"class.spirv_cross::TypedID.165", %"class.spirv_cross::TypedID.165", %struct.anon, %"class.spirv_cross::SmallVector.208", %"class.spirv_cross::SmallVector.211", %"class.spirv_cross::SmallVector.214", %"class.spirv_cross::SmallVector.214", %"class.spirv_cross::SmallVector.217", %"class.spirv_cross::SmallVector.217", i8, i8, i8, %"class.spirv_cross::TypedID.165", %"class.spirv_cross::TypedID.165", %"class.spirv_cross::SmallVector.220", %"class.spirv_cross::SmallVector.220", %"class.spirv_cross::SmallVector.7" }
%"struct.spirv_cross::IVariant.base" = type <{ ptr, %"class.spirv_cross::TypedID.162" }>
%struct.anon = type { [3 x %"class.spirv_cross::TypedID.162"], %"class.spirv_cross::TypedID.162" }
%"class.spirv_cross::SmallVector.208" = type { %"class.spirv_cross::VectorView.209", i64, %"class.spirv_cross::AlignedBuffer.210" }
%"class.spirv_cross::VectorView.209" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.210" = type { [96 x i8] }
%"class.spirv_cross::SmallVector.211" = type { %"class.spirv_cross::VectorView.212", i64, %"class.spirv_cross::AlignedBuffer.213" }
%"class.spirv_cross::VectorView.212" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.213" = type { [96 x i8] }
%"class.spirv_cross::SmallVector.214" = type { %"class.spirv_cross::VectorView.215", i64, %"class.spirv_cross::AlignedBuffer.216" }
%"class.spirv_cross::VectorView.215" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.216" = type { [64 x i8] }
%"class.spirv_cross::SmallVector.217" = type { %"class.spirv_cross::VectorView.218", i64, %"class.spirv_cross::AlignedBuffer.219" }
%"class.spirv_cross::VectorView.218" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.219" = type { [128 x i8] }
%"class.spirv_cross::TypedID.165" = type { i32 }
%"class.spirv_cross::SmallVector.220" = type { %"class.spirv_cross::VectorView.221", i64, %"class.spirv_cross::AlignedBuffer.222" }
%"class.spirv_cross::VectorView.221" = type { ptr, i64 }
%"class.spirv_cross::AlignedBuffer.222" = type { [32 x i8] }
%"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] }

; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE6EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK11spirv_cross8Compiler13block_is_noopERKNS_9SPIRBlockE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(976)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK11spirv_cross8Compiler17execution_is_noopERKNS_9SPIRBlockES3_(ptr noundef nonnull align 8 dereferenceable(3176) %0, ptr noundef nonnull align 8 dereferenceable(976) %1, ptr noundef nonnull align 8 dereferenceable(976) %2) #2 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = call noundef zeroext i1 @_ZNK11spirv_cross8Compiler23execution_is_branchlessERKNS_9SPIRBlockES3_(ptr noundef nonnull align 8 dereferenceable(3176) %11, ptr noundef nonnull align 8 dereferenceable(976) %12, ptr noundef nonnull align 8 dereferenceable(976) %13)
  br i1 %14, label %16, label %15

15:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  br label %38

16:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %17, ptr %8, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %31, %16
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.spirv_cross::IVariant", ptr %19, i32 0, i32 1
  %21 = call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %20)
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.spirv_cross::IVariant", ptr %22, i32 0, i32 1
  %24 = call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %23)
  %25 = icmp eq i32 %21, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %18
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %37

27:                                               ; preds = %18
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = call noundef zeroext i1 @_ZNK11spirv_cross8Compiler13block_is_noopERKNS_9SPIRBlockE(ptr noundef nonnull align 8 dereferenceable(3176) %11, ptr noundef nonnull align 8 dereferenceable(976) %28)
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %37

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.spirv_cross::SPIRBlock", ptr %32, i32 0, i32 4
  %34 = call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE6EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %33)
  %35 = call noundef nonnull align 8 dereferenceable(976) ptr @_ZNK11spirv_cross8Compiler3getINS_9SPIRBlockEEERKT_j(ptr noundef nonnull align 8 dereferenceable(3176) %11, i32 noundef %34)
  store ptr %35, ptr %10, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %36, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %18, !llvm.loop !9

37:                                               ; preds = %30, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %38

38:                                               ; preds = %37, %15
  %39 = load i1, ptr %4, align 1
  ret i1 %39
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK11spirv_cross8Compiler23execution_is_branchlessERKNS_9SPIRBlockES3_(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(976), ptr noundef nonnull align 8 dereferenceable(976)) #2 align 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE6EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4)) 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 #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK11spirv_cross8Compiler13block_is_noopERKNS_9SPIRBlockE(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(976)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK11spirv_cross8Compiler17execution_is_noopERKNS_9SPIRBlockES3_(ptr noundef nonnull align 8 dereferenceable(3176) %0, ptr noundef nonnull align 8 dereferenceable(976) %1, ptr noundef nonnull align 8 dereferenceable(976) %2) local_unnamed_addr #1 align 2 {
  %4 = tail call noundef zeroext i1 @_ZNK11spirv_cross8Compiler23execution_is_branchlessERKNS_9SPIRBlockES3_(ptr noundef nonnull align 8 dereferenceable(3176) %0, ptr noundef nonnull align 8 dereferenceable(976) %1, ptr noundef nonnull align 8 dereferenceable(976) %2)
  br i1 %4, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %3
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %5)
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  %8 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %7)
  %9 = icmp eq i32 %6, %8
  br i1 %9, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %11
  %.01011 = phi ptr [ %14, %11 ], [ %1, %.preheader ]
  %10 = tail call noundef zeroext i1 @_ZNK11spirv_cross8Compiler13block_is_noopERKNS_9SPIRBlockE(ptr noundef nonnull align 8 dereferenceable(3176) %0, ptr noundef nonnull align 8 dereferenceable(976) %.01011)
  br i1 %10, label %11, label %.loopexit

11:                                               ; preds = %.lr.ph
  %12 = getelementptr inbounds i8, ptr %.01011, i64 24
  %13 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE6EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %12)
  %14 = tail call noundef nonnull align 8 dereferenceable(976) ptr @_ZNK11spirv_cross8Compiler3getINS_9SPIRBlockEEERKT_j(ptr noundef nonnull align 8 dereferenceable(3176) %0, i32 noundef %13)
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %15)
  %17 = tail call noundef i32 @_ZNK11spirv_cross7TypedIDILNS_5TypesE0EEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %7)
  %18 = icmp eq i32 %16, %17
  br i1 %18, label %.loopexit, label %.lr.ph, !llvm.loop !5

.loopexit:                                        ; preds = %.lr.ph, %11, %.preheader, %3
  %.1 = phi i1 [ false, %3 ], [ true, %.preheader ], [ %10, %11 ], [ %10, %.lr.ph ]
  ret i1 %.1
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK11spirv_cross8Compiler23execution_is_branchlessERKNS_9SPIRBlockES3_(ptr noundef nonnull align 8 dereferenceable(3176), ptr noundef nonnull align 8 dereferenceable(976), ptr noundef nonnull align 8 dereferenceable(976)) local_unnamed_addr #1 align 2

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

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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