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

; 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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.82" }
%"struct.std::_Head_base.82" = type { 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" }
%"struct.spv::IdImmediate" = type { i8, i32 }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3spv11InstructionC2EjjNS_2OpE(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIN3spv11InstructionESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK3spv11Instruction11getResultIdEv(ptr noundef nonnull align 8 dereferenceable(96)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3spv7Builder15makeGenericTypeENS_2OpERSt6vectorINS_11IdImmediateESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::unique_ptr", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %21

21:                                               ; preds = %97, %3
  %22 = load i32, ptr %9, align 4, !tbaa !11
  %23 = getelementptr inbounds %"class.spv::Builder", ptr %20, i32 0, i32 34
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %24 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %24, ptr %10, align 4, !tbaa !11
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56) %23, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %26 = call noundef i64 @_ZNKSt6vectorIPN3spv11InstructionESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %27 = trunc i64 %26 to i32
  %28 = icmp slt i32 %22, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br i1 %28, label %30, label %29

29:                                               ; preds = %21
  store i32 2, ptr %11, align 4
  br label %100

30:                                               ; preds = %21
  %31 = getelementptr inbounds %"class.spv::Builder", ptr %20, i32 0, i32 34
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %32 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %32, ptr %12, align 4, !tbaa !11
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56) %31, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %34 = load i32, ptr %9, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN3spv11InstructionESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %35) #5
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  store ptr %37, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %38)
  %40 = sext i32 %39 to i64
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = call noundef i64 @_ZNKSt6vectorIN3spv11IdImmediateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #5
  %43 = icmp ne i64 %40, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %30
  br label %97

45:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i8 1, ptr %13, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %46

46:                                               ; preds = %84, %45
  %47 = load i8, ptr %13, align 1, !tbaa !13, !range !15, !noundef !16
  %48 = trunc i8 %47 to i1
  br i1 %48, label %49, label %55

49:                                               ; preds = %46
  %50 = load i32, ptr %14, align 4, !tbaa !11
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = call noundef i64 @_ZNKSt6vectorIN3spv11IdImmediateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #5
  %53 = trunc i64 %52 to i32
  %54 = icmp slt i32 %50, %53
  br label %55

55:                                               ; preds = %49, %46
  %56 = phi i1 [ false, %46 ], [ %54, %49 ]
  br i1 %56, label %58, label %57

57:                                               ; preds = %55
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %87

58:                                               ; preds = %55
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load i32, ptr %14, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %61) #5
  %63 = getelementptr inbounds %"struct.spv::IdImmediate", ptr %62, i32 0, i32 0
  %64 = load i8, ptr %63, align 4, !tbaa !17, !range !15, !noundef !16
  %65 = trunc i8 %64 to i1
  br i1 %65, label %66, label %70

66:                                               ; preds = %58
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = load i32, ptr %14, align 4, !tbaa !11
  %69 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %67, i32 noundef %68)
  br label %74

70:                                               ; preds = %58
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load i32, ptr %14, align 4, !tbaa !11
  %73 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %71, i32 noundef %72)
  br label %74

74:                                               ; preds = %70, %66
  %75 = phi i32 [ %69, %66 ], [ %73, %70 ]
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = load i32, ptr %14, align 4, !tbaa !11
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %78) #5
  %80 = getelementptr inbounds %"struct.spv::IdImmediate", ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !19
  %82 = icmp eq i32 %75, %81
  %83 = zext i1 %82 to i8
  store i8 %83, ptr %13, align 1, !tbaa !13
  br label %84

84:                                               ; preds = %74
  %85 = load i32, ptr %14, align 4, !tbaa !11
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %14, align 4, !tbaa !11
  br label %46, !llvm.loop !20

87:                                               ; preds = %57
  %88 = load i8, ptr %13, align 1, !tbaa !13, !range !15, !noundef !16
  %89 = trunc i8 %88 to i1
  br i1 %89, label %90, label %93

90:                                               ; preds = %87
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = call noundef i32 @_ZNK3spv11Instruction11getResultIdEv(ptr noundef nonnull align 8 dereferenceable(96) %91)
  store i32 %92, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %94

93:                                               ; preds = %87
  store i32 0, ptr %11, align 4
  br label %94

94:                                               ; preds = %93, %90
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  %95 = load i32, ptr %11, align 4
  switch i32 %95, label %100 [
    i32 0, label %96
  ]

96:                                               ; preds = %94
  br label %97

97:                                               ; preds = %96, %44
  %98 = load i32, ptr %9, align 4, !tbaa !11
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !11
  br label %21, !llvm.loop !22

100:                                              ; preds = %94, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %101 = load i32, ptr %11, align 4
  switch i32 %101, label %158 [
    i32 2, label %102
  ]

102:                                              ; preds = %100
  %103 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 96) #6
  %104 = invoke noundef i32 @_ZN3spv7Builder11getUniqueIdEv(ptr noundef nonnull align 8 dereferenceable(1096) %20)
          to label %105 unwind label %114

105:                                              ; preds = %102
  %106 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @_ZN3spv11InstructionC2EjjNS_2OpE(ptr noundef nonnull align 8 dereferenceable(96) %103, i32 noundef %104, i32 noundef 0, i32 noundef %106)
          to label %107 unwind label %114

107:                                              ; preds = %105
  store ptr %103, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 0, ptr %17, align 8, !tbaa !23
  br label %108

108:                                              ; preds = %140, %107
  %109 = load i64, ptr %17, align 8, !tbaa !23
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = call noundef i64 @_ZNKSt6vectorIN3spv11IdImmediateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %110) #5
  %112 = icmp ult i64 %109, %111
  br i1 %112, label %118, label %113

113:                                              ; preds = %108
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %143

114:                                              ; preds = %105, %102
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %15, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %16, align 4
  call void @_ZdlPvm(ptr noundef %103, i64 noundef 96) #7
  br label %160

118:                                              ; preds = %108
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = load i64, ptr %17, align 8, !tbaa !23
  %121 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %119, i64 noundef %120) #5
  %122 = getelementptr inbounds %"struct.spv::IdImmediate", ptr %121, i32 0, i32 0
  %123 = load i8, ptr %122, align 4, !tbaa !17, !range !15, !noundef !16
  %124 = trunc i8 %123 to i1
  br i1 %124, label %125, label %132

125:                                              ; preds = %118
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = load i64, ptr %17, align 8, !tbaa !23
  %129 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %127, i64 noundef %128) #5
  %130 = getelementptr inbounds %"struct.spv::IdImmediate", ptr %129, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !19
  call void @_ZN3spv11Instruction12addIdOperandEj(ptr noundef nonnull align 8 dereferenceable(96) %126, i32 noundef %131)
  br label %139

132:                                              ; preds = %118
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = load i64, ptr %17, align 8, !tbaa !23
  %136 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %134, i64 noundef %135) #5
  %137 = getelementptr inbounds %"struct.spv::IdImmediate", ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !19
  call void @_ZN3spv11Instruction19addImmediateOperandEj(ptr noundef nonnull align 8 dereferenceable(96) %133, i32 noundef %138)
  br label %139

139:                                              ; preds = %132, %125
  br label %140

140:                                              ; preds = %139
  %141 = load i64, ptr %17, align 8, !tbaa !23
  %142 = add i64 %141, 1
  store i64 %142, ptr %17, align 8, !tbaa !23
  br label %108, !llvm.loop !25

143:                                              ; preds = %113
  %144 = getelementptr inbounds %"class.spv::Builder", ptr %20, i32 0, i32 34
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %145 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %145, ptr %18, align 4, !tbaa !11
  %146 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56) %144, ptr noundef nonnull align 4 dereferenceable(4) %18)
  call void @_ZNSt6vectorIPN3spv11InstructionESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %146, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %147 = getelementptr inbounds %"class.spv::Builder", ptr %20, i32 0, i32 29
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZNSt10unique_ptrIN3spv11InstructionESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef %148) #5
  invoke void @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE9push_backEOS5_(ptr noundef nonnull align 8 dereferenceable(24) %147, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %149 unwind label %154

149:                                              ; preds = %143
  call void @_ZNSt10unique_ptrIN3spv11InstructionESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %150 = getelementptr inbounds %"class.spv::Builder", ptr %20, i32 0, i32 16
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3spv6Module14mapInstructionEPNS_11InstructionE(ptr noundef nonnull align 8 dereferenceable(56) %150, ptr noundef %151)
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = call noundef i32 @_ZNK3spv11Instruction11getResultIdEv(ptr noundef nonnull align 8 dereferenceable(96) %152)
  store i32 %153, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %158

154:                                              ; preds = %143
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %15, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %16, align 4
  call void @_ZNSt10unique_ptrIN3spv11InstructionESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %160

158:                                              ; preds = %149, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %159 = load i32, ptr %4, align 4
  ret i32 %159

160:                                              ; preds = %154, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %15, align 8
  %163 = load i32, ptr %16, align 4
  %164 = insertvalue { ptr, i32 } poison, ptr %162, 0
  %165 = insertvalue { ptr, i32 } %164, i32 %163, 1
  resume { ptr, i32 } %165
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

attributes #0 = { nobuiltin 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { builtin 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 = !{!"_ZTSN3spv2OpE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !14, i64 0}
!18 = !{!"_ZTSN3spv11IdImmediateE", !14, i64 0, !12, i64 4}
!19 = !{!18, !12, i64 4}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!24, !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = distinct !{!25, !21}


; 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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.82" }
%"struct.std::_Head_base.82" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3spv6Module14mapInstructionEPNS_11InstructionE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE9push_backEOS5_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress 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 @_ZNK3spv11Instruction11getResultIdEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN3spv11InstructionESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

; 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
define dso_local noundef i32 @_ZN3spv7Builder15makeGenericTypeENS_2OpERSt6vectorINS_11IdImmediateESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::unique_ptr", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 744
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 %1, ptr %5, align 4, !tbaa !5
  %10 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56) %9, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %11 = call noundef i64 @_ZNKSt6vectorIPN3spv11InstructionESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %12 = trunc i64 %11 to i32
  %.not4046 = icmp sgt i32 %12, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br i1 %.not4046, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %3, %.critedge41
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %.critedge41 ], [ 0, %3 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 %1, ptr %6, align 4, !tbaa !5
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56) %9, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN3spv11InstructionESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv52) #4
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %16 = call noundef i32 @_ZNK3spv11Instruction14getNumOperandsEv(ptr noundef nonnull align 8 dereferenceable(96) %15)
  %17 = sext i32 %16 to i64
  %18 = call noundef i64 @_ZNKSt6vectorIN3spv11IdImmediateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not = icmp eq i64 %18, %17
  br i1 %.not, label %.preheader, label %.critedge41

.preheader:                                       ; preds = %.lr.ph, %31
  %indvars.iv = phi i64 [ %indvars.iv.next, %31 ], [ 0, %.lr.ph ]
  %19 = call noundef i64 @_ZNKSt6vectorIN3spv11IdImmediateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %sext = shl i64 %19, 32
  %20 = ashr exact i64 %sext, 32
  %21 = icmp slt i64 %indvars.iv, %20
  br i1 %21, label %22, label %.loopexit

22:                                               ; preds = %.preheader
  %23 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %24 = load i8, ptr %23, align 4, !tbaa !11, !range !14, !noundef !15
  %25 = trunc nuw i8 %24 to i1
  %26 = trunc nuw nsw i64 %indvars.iv to i32
  br i1 %25, label %27, label %29

27:                                               ; preds = %22
  %28 = call noundef i32 @_ZNK3spv11Instruction12getIdOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef %26)
  br label %31

29:                                               ; preds = %22
  %30 = call noundef i32 @_ZNK3spv11Instruction19getImmediateOperandEi(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef %26)
  br label %31

31:                                               ; preds = %29, %27
  %32 = phi i32 [ %28, %27 ], [ %30, %29 ]
  %33 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %34 = getelementptr inbounds i8, ptr %33, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !16
  %36 = icmp eq i32 %32, %35
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %36, label %.preheader, label %.critedge41, !llvm.loop !17

.critedge41:                                      ; preds = %31, %.lr.ph
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 %1, ptr %5, align 4, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56) %9, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %38 = call noundef i64 @_ZNKSt6vectorIPN3spv11InstructionESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #4
  %sext55 = shl i64 %38, 32
  %39 = ashr exact i64 %sext55, 32
  %.not40 = icmp slt i64 %indvars.iv.next53, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br i1 %.not40, label %.lr.ph, label %.thread, !llvm.loop !19

.thread:                                          ; preds = %.critedge41, %3
  %40 = call noalias noundef nonnull dereferenceable(96) ptr @_Znwm(i64 noundef 96) #5
  %41 = call noundef i32 @_ZN3spv7Builder11getUniqueIdEv(ptr noundef nonnull align 8 dereferenceable(1096) %0)
  call void @_ZN3spv11InstructionC2EjjNS_2OpE(ptr noundef nonnull align 8 dereferenceable(96) %40, i32 noundef %41, i32 noundef 0, i32 noundef %1)
  store ptr %40, ptr %4, align 8, !tbaa !9
  %42 = call noundef i64 @_ZNKSt6vectorIN3spv11IdImmediateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not50 = icmp eq i64 %42, 0
  br i1 %.not50, label %._crit_edge, label %.lr.ph49

._crit_edge:                                      ; preds = %54, %.thread
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 %1, ptr %7, align 4, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt13unordered_mapIjSt6vectorIPN3spv11InstructionESaIS3_EESt4hashIjESt8equal_toIjESaISt4pairIKjS5_EEEixEOj(ptr noundef nonnull align 8 dereferenceable(56) %9, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @_ZNSt6vectorIPN3spv11InstructionESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %44 = getelementptr inbounds i8, ptr %0, i64 560
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %45 = load ptr, ptr %4, align 8, !tbaa !9
  call void @_ZNSt10unique_ptrIN3spv11InstructionESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef %45) #4
  invoke void @_ZNSt6vectorISt10unique_ptrIN3spv11InstructionESt14default_deleteIS2_EESaIS5_EE9push_backEOS5_(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %58 unwind label %62

.lr.ph49:                                         ; preds = %.thread, %54
  %.048 = phi i64 [ %55, %54 ], [ 0, %.thread ]
  %46 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.048) #4
  %47 = load i8, ptr %46, align 4, !tbaa !11, !range !14, !noundef !15
  %48 = trunc nuw i8 %47 to i1
  %49 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN3spv11IdImmediateESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.048) #4
  %50 = getelementptr inbounds i8, ptr %49, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !16
  br i1 %48, label %52, label %53

52:                                               ; preds = %.lr.ph49
  call void @_ZN3spv11Instruction12addIdOperandEj(ptr noundef nonnull align 8 dereferenceable(96) %40, i32 noundef %51)
  br label %54

53:                                               ; preds = %.lr.ph49
  call void @_ZN3spv11Instruction19addImmediateOperandEj(ptr noundef nonnull align 8 dereferenceable(96) %40, i32 noundef %51)
  br label %54

54:                                               ; preds = %52, %53
  %55 = add nuw i64 %.048, 1
  %56 = call noundef i64 @_ZNKSt6vectorIN3spv11IdImmediateESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %57 = icmp ult i64 %55, %56
  br i1 %57, label %.lr.ph49, label %._crit_edge, !llvm.loop !20

58:                                               ; preds = %._crit_edge
  call void @_ZNSt10unique_ptrIN3spv11InstructionESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  %59 = getelementptr inbounds i8, ptr %0, i64 240
  %60 = load ptr, ptr %4, align 8, !tbaa !9
  call void @_ZN3spv6Module14mapInstructionEPNS_11InstructionE(ptr noundef nonnull align 8 dereferenceable(56) %59, ptr noundef %60)
  %61 = load ptr, ptr %4, align 8, !tbaa !9
  br label %.loopexit

62:                                               ; preds = %._crit_edge
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt10unique_ptrIN3spv11InstructionESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  resume { ptr, i32 } %63

.loopexit:                                        ; preds = %.preheader, %58
  %.lcssa.sink = phi ptr [ %61, %58 ], [ %15, %.preheader ]
  %64 = call noundef i32 @_ZNK3spv11Instruction11getResultIdEv(ptr noundef nonnull align 8 dereferenceable(96) %.lcssa.sink)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  ret i32 %64
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { 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 #4 = { nounwind }
attributes #5 = { builtin allocsize(0) }

!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 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN3spv11IdImmediateE", !13, i64 0, !6, i64 4}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!12, !6, i64 4}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass