; LLVM IR from hbatagelo/abcg :: abcg/external/glslang/SPIRV (SpvPostProcess)

; 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.anon = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon.81 = type { ptr, ptr }
%"class.spv::Builder" = type { ptr, i32, i32, i32, i32, %"class.std::__cxx11::basic_string", i32, ptr, i8, %"class.std::set", %"class.std::vector", %"class.std::vector", i32, i32, %"class.std::set.6", i32, %"class.spv::Module", ptr, i32, ptr, i8, [7 x i8], %"struct.spv::Builder::AccessChain", %"class.std::vector.27", %"class.std::vector.27", %"class.std::vector.27", %"class.std::vector.27", %"class.std::vector.27", %"class.std::vector.27", %"class.std::vector.27", %"class.std::vector.27", %"class.std::vector.32", %"class.std::unordered_map", %"class.std::unordered_map", %"class.std::unordered_map", %"class.std::vector.17", %"class.std::stack", %"class.std::stack.45", %"class.std::unordered_map.52", %"class.std::map", ptr }
%"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.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl" }
%"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set.6" = type { %"class.std::_Rb_tree.7" }
%"class.std::_Rb_tree.7" = type { %"struct.std::_Rb_tree<spv::Capability, spv::Capability, std::_Identity<spv::Capability>, std::less<spv::Capability>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<spv::Capability, spv::Capability, std::_Identity<spv::Capability>, std::less<spv::Capability>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.spv::Module" = type { ptr, %"class.std::vector.12", %"class.std::vector.17" }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<spv::Function *, std::allocator<spv::Function *>>::_Vector_impl" }
%"struct.std::_Vector_base<spv::Function *, std::allocator<spv::Function *>>::_Vector_impl" = type { %"struct.std::_Vector_base<spv::Function *, std::allocator<spv::Function *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<spv::Function *, std::allocator<spv::Function *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.spv::Builder::AccessChain" = type <{ i32, [4 x i8], %"class.std::vector.22", i32, [4 x i8], %"class.std::vector.22", i32, i32, i8, [3 x i8], i32, %"struct.spv::Builder::AccessChain::CoherentFlags", [4 x i8] }>
%"class.std::vector.22" = type { %"struct.std::_Vector_base.23" }
%"struct.std::_Vector_base.23" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.spv::Builder::AccessChain::CoherentFlags" = type { i16, [2 x i8] }
%"class.std::vector.27" = type { %"struct.std::_Vector_base.28" }
%"struct.std::_Vector_base.28" = type { %"struct.std::_Vector_base<std::unique_ptr<spv::Instruction>, std::allocator<std::unique_ptr<spv::Instruction>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<spv::Instruction>, std::allocator<std::unique_ptr<spv::Instruction>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<spv::Instruction>, std::allocator<std::unique_ptr<spv::Instruction>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<spv::Instruction>, std::allocator<std::unique_ptr<spv::Instruction>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = type { %"struct.std::_Vector_base<std::unique_ptr<spv::Function>, std::allocator<std::unique_ptr<spv::Function>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<spv::Function>, std::allocator<std::unique_ptr<spv::Function>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<spv::Function>, std::allocator<std::unique_ptr<spv::Function>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<spv::Function>, std::allocator<std::unique_ptr<spv::Function>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = 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::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<spv::Instruction *, std::allocator<spv::Instruction *>>::_Vector_impl" }
%"struct.std::_Vector_base<spv::Instruction *, std::allocator<spv::Instruction *>>::_Vector_impl" = type { %"struct.std::_Vector_base<spv::Instruction *, std::allocator<spv::Instruction *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<spv::Instruction *, std::allocator<spv::Instruction *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<spv::Block *, std::allocator<spv::Block *>>::_Deque_impl" }
%"struct.std::_Deque_base<spv::Block *, std::allocator<spv::Block *>>::_Deque_impl" = type { %"struct.std::_Deque_base<spv::Block *, std::allocator<spv::Block *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<spv::Block *, std::allocator<spv::Block *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::stack.45" = type { %"class.std::deque.46" }
%"class.std::deque.46" = type { %"class.std::_Deque_base.47" }
%"class.std::_Deque_base.47" = type { %"struct.std::_Deque_base<spv::Builder::LoopBlocks, std::allocator<spv::Builder::LoopBlocks>>::_Deque_impl" }
%"struct.std::_Deque_base<spv::Builder::LoopBlocks, std::allocator<spv::Builder::LoopBlocks>>::_Deque_impl" = type { %"struct.std::_Deque_base<spv::Builder::LoopBlocks, std::allocator<spv::Builder::LoopBlocks>>::_Deque_impl_data" }
%"struct.std::_Deque_base<spv::Builder::LoopBlocks, std::allocator<spv::Builder::LoopBlocks>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.51", %"struct.std::_Deque_iterator.51" }
%"struct.std::_Deque_iterator.51" = type { ptr, ptr, ptr, ptr }
%"class.std::unordered_map.52" = type { %"class.std::_Hashtable.53" }
%"class.std::_Hashtable.53" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.72" }
%"class.std::_Rb_tree.72" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, const std::__cxx11::basic_string<char> *>, std::_Select1st<std::pair<const unsigned int, const std::__cxx11::basic_string<char> *>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, const std::__cxx11::basic_string<char> *>, std::_Select1st<std::pair<const unsigned int, const std::__cxx11::basic_string<char> *>>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE = external hidden unnamed_addr constant [46 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3spv7Builder15postProcessTypeERKNS_11InstructionEj(ptr noundef nonnull align 8 dereferenceable(1096), ptr noundef nonnull align 8 dereferenceable(96), i32 noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096), i32 noundef) #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3spv7Builder12addExtensionEPKc(ptr noundef nonnull align 8 dereferenceable(1096), ptr noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3spv7Builder11postProcessERNS_11InstructionE(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %class.anon, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %class.anon, align 8
  %18 = alloca %class.anon, align 8
  %19 = alloca %class.anon.81, align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %class.anon.81, align 8
  %23 = alloca %class.anon.81, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %28)
  switch i32 %29, label %212 [
    i32 12, label %30
    i32 210, label %36
    i32 211, label %36
    i32 212, label %36
    i32 213, label %36
    i32 214, label %36
    i32 215, label %36
    i32 105, label %37
    i32 104, label %37
    i32 103, label %37
    i32 107, label %37
    i32 106, label %37
    i32 5296, label %38
    i32 61, label %39
    i32 62, label %39
  ]

30:                                               ; preds = %2
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %31, i32 noundef 1)
  switch i32 %32, label %34 [
    i32 76, label %33
    i32 77, label %33
    i32 78, label %33
  ]

33:                                               ; preds = %30, %30, %30
  call void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096) %27, i32 noundef 52)
  br label %35

34:                                               ; preds = %30
  br label %35

35:                                               ; preds = %34, %33
  br label %213

36:                                               ; preds = %2, %2, %2, %2, %2, %2
  call void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096) %27, i32 noundef 51)
  br label %213

37:                                               ; preds = %2, %2, %2, %2, %2
  call void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096) %27, i32 noundef 50)
  br label %213

38:                                               ; preds = %2
  call void @_ZN3spv7Builder12addExtensionEPKc(ptr noundef nonnull align 8 dereferenceable(1096) %27, ptr noundef @.str.3)
  call void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096) %27, i32 noundef 5297)
  br label %213

39:                                               ; preds = %2, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %40 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 16
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %41, i32 noundef 0)
  %43 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %40, i32 noundef %42)
  store ptr %43, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %44)
  %46 = icmp eq i32 %45, 65
  br i1 %46, label %47, label %210

47:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %48 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 16
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %49, i32 noundef 0)
  %51 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %48, i32 noundef %50)
  store ptr %51, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = call noundef i32 @_ZNK3spv11Instruction9getTypeIdEv(ptr noundef nonnull align 8 dereferenceable(96) %52)
  store i32 %53, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %54 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 16
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %54, i32 noundef %55)
  store ptr %56, ptr %8, align 8, !tbaa !5
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %57)
  %59 = icmp eq i32 %58, 32
  br i1 %59, label %60, label %61

60:                                               ; preds = %47
  br label %63

61:                                               ; preds = %47
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.5, i32 noundef 253, ptr noundef @__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE) #6
  unreachable

62:                                               ; No predecessors!
  br label %63

63:                                               ; preds = %62, %60
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %64, i32 noundef 0)
  %66 = icmp ne i32 %65, 5349
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  store i32 2, ptr %9, align 4
  br label %207

68:                                               ; preds = %63
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %69, i32 noundef 1)
  store i32 %70, ptr %7, align 4, !tbaa !9
  %71 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 16
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %71, i32 noundef %72)
  store ptr %73, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %159, %68
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %76)
  %78 = icmp slt i32 %75, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %74
  store i32 4, ptr %9, align 4
  br label %162

80:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %81 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 16
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %82, i32 noundef %83)
  %85 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %81, i32 noundef %84)
  store ptr %85, ptr %12, align 8, !tbaa !5
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %86)
  %88 = icmp eq i32 %87, 30
  br i1 %88, label %89, label %118

89:                                               ; preds = %80
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %90)
  %92 = icmp eq i32 %91, 43
  br i1 %92, label %93, label %94

93:                                               ; preds = %89
  br label %96

94:                                               ; preds = %89
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.5, i32 noundef 268, ptr noundef @__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE) #6
  unreachable

95:                                               ; No predecessors!
  br label %96

96:                                               ; preds = %95, %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %97, i32 noundef 0)
  store i32 %98, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %99 = getelementptr inbounds %class.anon, ptr %14, i32 0, i32 0
  store ptr %7, ptr %99, align 8, !tbaa !5
  %100 = getelementptr inbounds %class.anon, ptr %14, i32 0, i32 1
  store ptr %13, ptr %100, align 8, !tbaa !5
  %101 = getelementptr inbounds %class.anon, ptr %14, i32 0, i32 2
  store ptr %10, ptr %101, align 8, !tbaa !5
  %102 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 28
  %103 = call ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %102) #5
  %104 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %103, ptr %104, align 8
  %105 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 28
  %106 = call ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %105) #5
  %107 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %106, ptr %107, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %14, i64 24, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #5
  %108 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8
  call void @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIN3spv11InstructionESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEZNS3_7Builder11postProcessERS4_E3$_0ET0_T_SH_SG_"(ptr dead_on_unwind writable sret(%class.anon) align 8 %18, ptr %109, ptr %111, ptr noundef byval(%class.anon) align 8 %17)
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %112, i32 noundef %113)
  store i32 %114, ptr %7, align 4, !tbaa !9
  %115 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 16
  %116 = load i32, ptr %7, align 4, !tbaa !9
  %117 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %115, i32 noundef %116)
  store ptr %117, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %155

118:                                              ; preds = %80
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %119)
  %121 = icmp eq i32 %120, 28
  br i1 %121, label %126, label %122

122:                                              ; preds = %118
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %123)
  %125 = icmp eq i32 %124, 29
  br i1 %125, label %126, label %153

126:                                              ; preds = %122, %118
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  %127 = getelementptr inbounds %class.anon.81, ptr %19, i32 0, i32 0
  store ptr %7, ptr %127, align 8, !tbaa !5
  %128 = getelementptr inbounds %class.anon.81, ptr %19, i32 0, i32 1
  store ptr %10, ptr %128, align 8, !tbaa !5
  %129 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 28
  %130 = call ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #5
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  %132 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 28
  %133 = call ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #5
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !12
  %135 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8
  %137 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8
  %139 = getelementptr inbounds { ptr, ptr }, ptr %22, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8
  %141 = getelementptr inbounds { ptr, ptr }, ptr %22, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8
  %143 = call { ptr, ptr } @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIN3spv11InstructionESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEZNS3_7Builder11postProcessERS4_E3$_1ET0_T_SH_SG_"(ptr %136, ptr %138, ptr %140, ptr %142)
  %144 = getelementptr inbounds { ptr, ptr }, ptr %23, i32 0, i32 0
  %145 = extractvalue { ptr, ptr } %143, 0
  store ptr %145, ptr %144, align 8
  %146 = getelementptr inbounds { ptr, ptr }, ptr %23, i32 0, i32 1
  %147 = extractvalue { ptr, ptr } %143, 1
  store ptr %147, ptr %146, align 8
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %148, i32 noundef 0)
  store i32 %149, ptr %7, align 4, !tbaa !9
  %150 = getelementptr inbounds %"class.spv::Builder", ptr %27, i32 0, i32 16
  %151 = load i32, ptr %7, align 4, !tbaa !9
  %152 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %150, i32 noundef %151)
  store ptr %152, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %154

153:                                              ; preds = %122
  store i32 4, ptr %9, align 4
  br label %156

154:                                              ; preds = %126
  br label %155

155:                                              ; preds = %154, %96
  store i32 0, ptr %9, align 4
  br label %156

156:                                              ; preds = %155, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %157 = load i32, ptr %9, align 4
  switch i32 %157, label %162 [
    i32 0, label %158
  ]

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %11, align 4, !tbaa !9
  br label %74, !llvm.loop !13

162:                                              ; preds = %156, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %164)
  %166 = icmp sge i32 %165, 3
  br i1 %166, label %167, label %168

167:                                              ; preds = %163
  br label %170

168:                                              ; preds = %163
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.5, i32 noundef 302, ptr noundef @__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE) #6
  unreachable

169:                                              ; No predecessors!
  br label %170

170:                                              ; preds = %169, %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %172)
  %174 = icmp eq i32 %173, 62
  %175 = zext i1 %174 to i64
  %176 = select i1 %174, i32 2, i32 1
  %177 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %171, i32 noundef %176)
  store i32 %177, ptr %24, align 4, !tbaa !9
  %178 = load i32, ptr %24, align 4, !tbaa !9
  %179 = and i32 %178, 2
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %182

181:                                              ; preds = %170
  br label %184

182:                                              ; preds = %170
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.5, i32 noundef 304, ptr noundef @__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE) #6
  unreachable

183:                                              ; No predecessors!
  br label %184

184:                                              ; preds = %183, %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 2, ptr %25, align 4, !tbaa !9
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %185)
  %187 = icmp eq i32 %186, 62
  br i1 %187, label %188, label %191

188:                                              ; preds = %184
  %189 = load i32, ptr %25, align 4, !tbaa !9
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %25, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %188, %184
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = load i32, ptr %25, align 4, !tbaa !9
  %194 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %192, i32 noundef %193)
  %195 = load i32, ptr %10, align 4, !tbaa !9
  %196 = or i32 %195, %194
  store i32 %196, ptr %10, align 4, !tbaa !9
  %197 = load i32, ptr %10, align 4, !tbaa !9
  %198 = load i32, ptr %10, align 4, !tbaa !9
  %199 = load i32, ptr %10, align 4, !tbaa !9
  %200 = sub nsw i32 %199, 1
  %201 = and i32 %198, %200
  %202 = xor i32 %201, -1
  %203 = and i32 %197, %202
  store i32 %203, ptr %10, align 4, !tbaa !9
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = load i32, ptr %25, align 4, !tbaa !9
  %206 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN3spv11Instruction19setImmediateOperandEjj(ptr noundef nonnull align 8 dereferenceable(96) %204, i32 noundef %205, i32 noundef %206)
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  store i32 0, ptr %9, align 4
  br label %207

207:                                              ; preds = %191, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %208 = load i32, ptr %9, align 4
  switch i32 %208, label %211 [
    i32 0, label %209
  ]

209:                                              ; preds = %207
  br label %210

210:                                              ; preds = %209, %39
  store i32 2, ptr %9, align 4
  br label %211

211:                                              ; preds = %210, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %213

212:                                              ; preds = %2
  br label %213

213:                                              ; preds = %212, %211, %38, %37, %36, %35
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = call noundef i32 @_ZNK3spv11Instruction9getTypeIdEv(ptr noundef nonnull align 8 dereferenceable(96) %214)
  %216 = icmp ne i32 %215, 0
  br i1 %216, label %217, label %221

217:                                              ; preds = %213
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = call noundef i32 @_ZNK3spv11Instruction9getTypeIdEv(ptr noundef nonnull align 8 dereferenceable(96) %219)
  call void @_ZN3spv7Builder15postProcessTypeERKNS_11InstructionEj(ptr noundef nonnull align 8 dereferenceable(1096) %27, ptr noundef nonnull align 8 dereferenceable(96) %218, i32 noundef %220)
  br label %221

221:                                              ; preds = %217, %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %222

222:                                              ; preds = %246, %221
  %223 = load i32, ptr %26, align 4, !tbaa !9
  %224 = load ptr, ptr %4, align 8, !tbaa !5
  %225 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %224)
  %226 = icmp slt i32 %223, %225
  br i1 %226, label %228, label %227

227:                                              ; preds = %222
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %249

228:                                              ; preds = %222
  %229 = load ptr, ptr %4, align 8, !tbaa !5
  %230 = load i32, ptr %26, align 4, !tbaa !9
  %231 = call noundef zeroext i1 @_ZNK3spv11Instruction11isIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %229, i32 noundef %230)
  br i1 %231, label %232, label %245

232:                                              ; preds = %228
  %233 = load ptr, ptr %4, align 8, !tbaa !5
  %234 = load i32, ptr %26, align 4, !tbaa !9
  %235 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %233, i32 noundef %234)
  %236 = call noundef i32 @_ZNK3spv7Builder9getTypeIdEj(ptr noundef nonnull align 8 dereferenceable(1096) %27, i32 noundef %235)
  %237 = icmp ne i32 %236, 0
  br i1 %237, label %238, label %244

238:                                              ; preds = %232
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = load ptr, ptr %4, align 8, !tbaa !5
  %241 = load i32, ptr %26, align 4, !tbaa !9
  %242 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %240, i32 noundef %241)
  %243 = call noundef i32 @_ZNK3spv7Builder9getTypeIdEj(ptr noundef nonnull align 8 dereferenceable(1096) %27, i32 noundef %242)
  call void @_ZN3spv7Builder15postProcessTypeERKNS_11InstructionEj(ptr noundef nonnull align 8 dereferenceable(1096) %27, ptr noundef nonnull align 8 dereferenceable(96) %239, i32 noundef %243)
  br label %244

244:                                              ; preds = %238, %232
  br label %245

245:                                              ; preds = %244, %228
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %26, align 4, !tbaa !9
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %26, align 4, !tbaa !9
  br label %222, !llvm.loop !15

249:                                              ; preds = %227
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIN3spv11InstructionESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEZNS3_7Builder11postProcessERS4_E3$_0ET0_T_SH_SG_"(ptr dead_on_unwind noalias writable sret(%class.anon) align 8, ptr, ptr, ptr noundef byval(%class.anon) align 8) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #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) #4

; Function Attrs: mustprogress uwtable
declare hidden { ptr, ptr } @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIN3spv11InstructionESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEZNS3_7Builder11postProcessERS4_E3$_1ET0_T_SH_SG_"(ptr, ptr, ptr, ptr) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3spv11Instruction19setImmediateOperandEjj(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3spv11Instruction11isIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3spv7Builder9getTypeIdEj(ptr noundef nonnull align 8 dereferenceable(1096), i32 noundef) #0 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn nounwind "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5}
!12 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.anon = type { ptr, ptr, ptr }

@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE = external hidden unnamed_addr constant [46 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3spv7Builder15postProcessTypeERKNS_11InstructionEj(ptr noundef nonnull align 8 dereferenceable(1096), ptr noundef nonnull align 8 dereferenceable(96), i32 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3spv7Builder11postProcessERNS_11InstructionE(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) local_unnamed_addr #0 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %class.anon, align 8
  %7 = alloca %class.anon, align 8
  %8 = tail call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  switch i32 %8, label %87 [
    i32 12, label %9
    i32 210, label %12
    i32 211, label %12
    i32 212, label %12
    i32 213, label %12
    i32 214, label %12
    i32 215, label %12
    i32 105, label %13
    i32 104, label %13
    i32 103, label %13
    i32 107, label %13
    i32 106, label %13
    i32 5296, label %14
    i32 61, label %15
    i32 62, label %15
  ]

9:                                                ; preds = %2
  %10 = tail call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef 1)
  %.off = add i32 %10, -76
  %switch = icmp ult i32 %.off, 3
  br i1 %switch, label %11, label %87

11:                                               ; preds = %9
  tail call void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef 52)
  br label %87

12:                                               ; preds = %2, %2, %2, %2, %2, %2
  tail call void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef 51)
  br label %87

13:                                               ; preds = %2, %2, %2, %2, %2
  tail call void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef 50)
  br label %87

14:                                               ; preds = %2
  tail call void @_ZN3spv7Builder12addExtensionEPKc(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef nonnull @.str.3)
  tail call void @_ZN3spv7Builder13addCapabilityENS_10CapabilityE(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef 5297)
  br label %87

15:                                               ; preds = %2, %2
  %16 = getelementptr inbounds i8, ptr %0, i64 240
  %17 = tail call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef 0)
  %18 = tail call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %17)
  %19 = tail call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %18)
  %20 = icmp eq i32 %19, 65
  br i1 %20, label %21, label %87

21:                                               ; preds = %15
  %22 = tail call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %18, i32 noundef 0)
  %23 = tail call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %22)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %24 = tail call noundef i32 @_ZNK3spv11Instruction9getTypeIdEv(ptr noundef nonnull align 8 dereferenceable(96) %23)
  %25 = tail call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %24)
  %26 = tail call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %25)
  %27 = icmp eq i32 %26, 32
  br i1 %27, label %29, label %28

28:                                               ; preds = %21
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, i32 noundef 253, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE) #5
  unreachable

29:                                               ; preds = %21
  %30 = tail call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %25, i32 noundef 0)
  %.not = icmp eq i32 %30, 5349
  br i1 %.not, label %31, label %.critedge

31:                                               ; preds = %29
  %32 = tail call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %25, i32 noundef 1)
  store i32 %32, ptr %3, align 4, !tbaa !5
  %33 = tail call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %32)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  %34 = tail call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %18)
  %35 = icmp sgt i32 %34, 1
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %31
  %36 = getelementptr inbounds i8, ptr %0, i64 536
  %.sroa.417.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 16
  br label %37

37:                                               ; preds = %.lr.ph, %65
  %.05667 = phi ptr [ %33, %.lr.ph ], [ %.2.ph, %65 ]
  %.05966 = phi i32 [ 1, %.lr.ph ], [ %66, %65 ]
  %38 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %18, i32 noundef %.05966)
  %39 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %38)
  %40 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %.05667)
  %41 = icmp eq i32 %40, 30
  br i1 %41, label %42, label %53

42:                                               ; preds = %37
  %43 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %39)
  %44 = icmp eq i32 %43, 43
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.5, i32 noundef 268, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE) #5
  unreachable

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %47 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %39, i32 noundef 0)
  store i32 %47, ptr %5, align 4, !tbaa !5
  %48 = call ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  %49 = call ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  store ptr %3, ptr %6, align 8, !tbaa !9
  store ptr %5, ptr %.sroa.417.0..sroa_idx, align 8, !tbaa !9
  store ptr %4, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIN3spv11InstructionESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEZNS3_7Builder11postProcessERS4_E3$_0ET0_T_SH_SG_"(ptr dead_on_unwind nonnull writable sret(%class.anon) align 8 %7, ptr %48, ptr %49, ptr noundef nonnull byval(%class.anon) align 8 %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %.05667, i32 noundef %50)
  store i32 %51, ptr %3, align 4, !tbaa !5
  %52 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %51)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %65

53:                                               ; preds = %37
  %54 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %.05667)
  %55 = icmp eq i32 %54, 28
  br i1 %55, label %59, label %56

56:                                               ; preds = %53
  %57 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %.05667)
  %58 = icmp eq i32 %57, 29
  br i1 %58, label %59, label %._crit_edge

59:                                               ; preds = %56, %53
  %60 = call ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  %61 = call ptr @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  %62 = call { ptr, ptr } @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIN3spv11InstructionESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEZNS3_7Builder11postProcessERS4_E3$_1ET0_T_SH_SG_"(ptr %60, ptr %61, ptr nonnull %3, ptr nonnull %4)
  %63 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %.05667, i32 noundef 0)
  store i32 %63, ptr %3, align 4, !tbaa !5
  %64 = call noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %63)
  br label %65

65:                                               ; preds = %59, %46
  %.2.ph = phi ptr [ %64, %59 ], [ %52, %46 ]
  %66 = add nuw nsw i32 %.05966, 1
  %67 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %18)
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %37, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %65, %56, %31
  %69 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  %70 = icmp sgt i32 %69, 2
  br i1 %70, label %72, label %71

71:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.5, i32 noundef 302, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE) #5
  unreachable

72:                                               ; preds = %._crit_edge
  %73 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  %74 = icmp eq i32 %73, 62
  %75 = select i1 %74, i32 2, i32 1
  %76 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef %75)
  %77 = and i32 %76, 2
  %.not60 = icmp eq i32 %77, 0
  br i1 %.not60, label %78, label %79

78:                                               ; preds = %72
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.5, i32 noundef 304, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3spv7Builder11postProcessERNS_11InstructionE) #5
  unreachable

79:                                               ; preds = %72
  %80 = call noundef i32 @_ZNK3spv11Instruction9getOpCodeEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  %81 = icmp eq i32 %80, 62
  %spec.select = select i1 %81, i32 3, i32 2
  %82 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef %spec.select)
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = or i32 %83, %82
  %85 = sub i32 0, %84
  %86 = and i32 %84, %85
  store i32 %86, ptr %4, align 4, !tbaa !5
  call void @_ZN3spv11Instruction19setImmediateOperandEjj(ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef %spec.select, i32 noundef %86)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %87

.critedge:                                        ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %87

87:                                               ; preds = %79, %.critedge, %15, %9, %2, %11, %14, %13, %12
  %88 = call noundef i32 @_ZNK3spv11Instruction9getTypeIdEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  %.not61 = icmp eq i32 %88, 0
  br i1 %.not61, label %91, label %89

89:                                               ; preds = %87
  %90 = call noundef i32 @_ZNK3spv11Instruction9getTypeIdEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  call void @_ZN3spv7Builder15postProcessTypeERKNS_11InstructionEj(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef %90)
  br label %91

91:                                               ; preds = %89, %87
  %92 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  %93 = icmp sgt i32 %92, 0
  br i1 %93, label %.lr.ph71, label %._crit_edge72

._crit_edge72:                                    ; preds = %101, %91
  ret void

.lr.ph71:                                         ; preds = %91, %101
  %.069 = phi i32 [ %102, %101 ], [ 0, %91 ]
  %94 = call noundef zeroext i1 @_ZNK3spv11Instruction11isIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef %.069)
  br i1 %94, label %95, label %101

95:                                               ; preds = %.lr.ph71
  %96 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef %.069)
  %97 = call noundef i32 @_ZNK3spv7Builder9getTypeIdEj(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef %96)
  %.not62 = icmp eq i32 %97, 0
  br i1 %.not62, label %101, label %98

98:                                               ; preds = %95
  %99 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef %.069)
  %100 = call noundef i32 @_ZNK3spv7Builder9getTypeIdEj(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef %99)
  call void @_ZN3spv7Builder15postProcessTypeERKNS_11InstructionEj(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef nonnull align 8 dereferenceable(96) %1, i32 noundef %100)
  br label %101

101:                                              ; preds = %.lr.ph71, %98, %95
  %102 = add nuw nsw i32 %.069, 1
  %103 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %.lr.ph71, label %._crit_edge72, !llvm.loop !13
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3spv6Module14getInstructionEj(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIN3spv11InstructionESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEZNS3_7Builder11postProcessERS4_E3$_0ET0_T_SH_SG_"(ptr dead_on_unwind noalias writable sret(%class.anon) align 8, ptr, ptr, ptr noundef byval(%class.anon) align 8) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare hidden { ptr, ptr } @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIN3spv11InstructionESt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEEZNS3_7Builder11postProcessERS4_E3$_1ET0_T_SH_SG_"(ptr, ptr, ptr, ptr) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3spv11Instruction11isIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3spv7Builder9getTypeIdEj(ptr noundef nonnull align 8 dereferenceable(1096), i32 noundef) local_unnamed_addr #0 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn nounwind "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 }
attributes #5 = { noreturn 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 = !{!"int", !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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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