; LLVM IR from kacperks/Fractal_Engine :: Engine/Thirdparty/cmake/Engine/Thirdparty/cmake/openal-soft/al (filter)

; 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.al::intrusive_ptr" = type { ptr }
%"class.std::lock_guard" = type { ptr }
%"class.std::vector.136" = type { %"struct.std::_Vector_base.137" }
%"struct.std::_Vector_base.137" = type { %"struct.std::_Vector_base<unsigned int, al::allocator<unsigned int, 4>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, al::allocator<unsigned int, 4>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, al::allocator<unsigned int, 4>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, al::allocator<unsigned int, 4>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.ALCcontext = type { %"class.al::intrusive_ref", [12 x i8], %struct.ContextBase, %"class.al::intrusive_ptr.25", %"class.std::vector.26", %"struct.al::atomic_invflag", %"struct.std::atomic.0", %"class.std::mutex", %"struct.std::atomic.30", i8, i8, float, float, float, %"class.std::mutex", ptr, ptr, %struct.ALlistener, %"class.std::vector.33", i32, %"class.std::mutex", %"class.std::vector.37", i32, %"class.std::mutex", %"class.std::unique_ptr.41", ptr }
%"class.al::intrusive_ref" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%struct.ContextBase = type { ptr, %"struct.std::atomic", %"struct.std::atomic.0", %"struct.std::atomic.0", float, %"struct.std::atomic.2", %"struct.std::atomic.4", %"struct.std::atomic.6", %"struct.std::atomic.8", ptr, %"struct.std::atomic.10", [8 x i8], %struct.ContextParams, %"struct.std::atomic.13", %"struct.std::atomic.15", %"struct.std::atomic.17", %"class.std::thread", %"class.al::semaphore", %"class.std::unique_ptr", %"struct.std::atomic", %"class.std::vector", %"class.std::vector.21" }
%"struct.std::atomic.2" = type { %"struct.std::__atomic_base.3" }
%"struct.std::__atomic_base.3" = type { ptr }
%"struct.std::atomic.4" = type { %"struct.std::__atomic_base.5" }
%"struct.std::__atomic_base.5" = type { ptr }
%"struct.std::atomic.6" = type { %"struct.std::__atomic_base.7" }
%"struct.std::__atomic_base.7" = type { ptr }
%"struct.std::atomic.8" = type { %"struct.std::__atomic_base.9" }
%"struct.std::__atomic_base.9" = type { ptr }
%"struct.std::atomic.10" = type { %"struct.std::__atomic_base.11" }
%"struct.std::__atomic_base.11" = type { ptr }
%struct.ContextParams = type <{ %"struct.std::atomic.2", %"struct.std::atomic.4", %"class.alu::VectorR", %"class.alu::MatrixR", %"class.alu::VectorR", float, float, float, float, i8, i8, [14 x i8] }>
%"class.alu::MatrixR" = type { %"struct.std::array.12" }
%"struct.std::array.12" = type { [16 x float] }
%"class.alu::VectorR" = type { %"struct.std::array" }
%"struct.std::array" = type { [4 x float] }
%"struct.std::atomic.13" = type { %"struct.std::__atomic_base.14" }
%"struct.std::__atomic_base.14" = type { ptr }
%"struct.std::atomic.15" = type { %"struct.std::__atomic_base.16" }
%"struct.std::__atomic_base.16" = type { i64 }
%"struct.std::atomic.17" = type { %"struct.std::__atomic_base.18" }
%"struct.std::__atomic_base.18" = type { ptr }
%"class.std::thread" = type { %"class.std::thread::id" }
%"class.std::thread::id" = type { i64 }
%"class.al::semaphore" = type { %union.sem_t }
%union.sem_t = type { i64, [24 x i8] }
%"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.20" }
%"struct.std::_Head_base.20" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::unique_ptr<VoiceChange[]>, al::allocator<std::unique_ptr<VoiceChange[]>, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<VoiceChange[]>, al::allocator<std::unique_ptr<VoiceChange[]>, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<VoiceChange[]>, al::allocator<std::unique_ptr<VoiceChange[]>, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<VoiceChange[]>, al::allocator<std::unique_ptr<VoiceChange[]>, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.21" = type { %"struct.std::_Vector_base.22" }
%"struct.std::_Vector_base.22" = type { %"struct.std::_Vector_base<std::unique_ptr<Voice[]>, al::allocator<std::unique_ptr<Voice[]>, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<Voice[]>, al::allocator<std::unique_ptr<Voice[]>, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<Voice[]>, al::allocator<std::unique_ptr<Voice[]>, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<Voice[]>, al::allocator<std::unique_ptr<Voice[]>, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.al::intrusive_ptr.25" = type { ptr }
%"class.std::vector.26" = type { %"struct.std::_Vector_base.27" }
%"struct.std::_Vector_base.27" = type { %"struct.std::_Vector_base<std::unique_ptr<WetBuffer>, al::allocator<std::unique_ptr<WetBuffer>, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<WetBuffer>, al::allocator<std::unique_ptr<WetBuffer>, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<WetBuffer>, al::allocator<std::unique_ptr<WetBuffer>, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<WetBuffer>, al::allocator<std::unique_ptr<WetBuffer>, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.al::atomic_invflag" = type { %"struct.std::atomic_flag" }
%"struct.std::atomic_flag" = type { %"struct.std::__atomic_flag_base" }
%"struct.std::__atomic_flag_base" = type { i8 }
%"struct.std::atomic.0" = type { %"struct.std::__atomic_base.1" }
%"struct.std::__atomic_base.1" = type { i8 }
%"struct.std::atomic.30" = type { %"struct.std::__atomic_base.31" }
%"struct.std::__atomic_base.31" = type { i32 }
%struct.ALlistener = type <{ %"struct.std::array.32", %"struct.std::array.32", %"struct.std::array.32", %"struct.std::array.32", float, float, %"struct.al::atomic_invflag", [3 x i8] }>
%"struct.std::array.32" = type { [3 x float] }
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = type { %"struct.std::_Vector_base<SourceSubList, al::allocator<SourceSubList, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<SourceSubList, al::allocator<SourceSubList, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<SourceSubList, al::allocator<SourceSubList, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SourceSubList, al::allocator<SourceSubList, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.37" = type { %"struct.std::_Vector_base.38" }
%"struct.std::_Vector_base.38" = type { %"struct.std::_Vector_base<EffectSlotSubList, al::allocator<EffectSlotSubList, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<EffectSlotSubList, al::allocator<EffectSlotSubList, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<EffectSlotSubList, al::allocator<EffectSlotSubList, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<EffectSlotSubList, al::allocator<EffectSlotSubList, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::unique_ptr.41" = type { %"struct.std::__uniq_ptr_data.42" }
%"struct.std::__uniq_ptr_data.42" = type { %"class.std::__uniq_ptr_impl.43" }
%"class.std::__uniq_ptr_impl.43" = type { %"class.std::tuple.44" }
%"class.std::tuple.44" = type { %"struct.std::_Tuple_impl.45" }
%"struct.std::_Tuple_impl.45" = type { %"struct.std::_Head_base.48" }
%"struct.std::_Head_base.48" = type { ptr }
%struct.ALCdevice = type { %"class.al::intrusive_ref.49", [12 x i8], %struct.DeviceBase, i32, i32, i32, i32, %"class.std::__cxx11::basic_string", %"class.std::vector.120", i32, i32, %"struct.std::atomic.30", %"class.std::mutex", %"class.std::vector.124", %"class.std::mutex", %"class.std::vector.128", %"class.std::mutex", %"class.std::vector.132", [8 x i8] }
%"class.al::intrusive_ref.49" = type { %"struct.std::atomic" }
%struct.DeviceBase = type { %"struct.std::atomic.0", i8, i32, i32, i32, i8, i8, i8, i32, float, i8, i8, %"class.std::__cxx11::basic_string", %"class.std::bitset", i32, i8, float, i32, %"class.std::chrono::duration", %"class.std::chrono::duration", [8 x i8], %"struct.std::array.50", [1024 x float], [1024 x float], %union.anon.52, [1408 x %"struct.std::array.53"], %"class.std::vector.54", %struct.MixParams, [4 x i32], %struct.RealMixParams, %"class.std::unique_ptr.61", %"class.al::intrusive_ptr.69", i32, %"class.std::unique_ptr.70", %"class.std::unique_ptr.78", %"class.std::unique_ptr.86", { i64, i64 }, %"class.std::unique_ptr.94", %"class.std::unique_ptr.102", float, i32, %"struct.std::atomic", %"struct.std::atomic.110", %"class.std::mutex", %"class.std::unique_ptr.112" }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { i64 }
%"class.std::chrono::duration" = type { i64 }
%"struct.std::array.50" = type { [16 x %"struct.std::array.51"] }
%"struct.std::array.51" = type { [1200 x float] }
%union.anon.52 = type { [1088 x float] }
%"struct.std::array.53" = type { [2 x float] }
%"class.std::vector.54" = type { %"struct.std::_Vector_base.55" }
%"struct.std::_Vector_base.55" = type { %"struct.std::_Vector_base<std::array<float, 1024>, al::allocator<std::array<float, 1024>, 16>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<float, 1024>, al::allocator<std::array<float, 1024>, 16>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<float, 1024>, al::allocator<std::array<float, 1024>, 16>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<float, 1024>, al::allocator<std::array<float, 1024>, 16>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.MixParams = type { %"struct.std::array.58", %"class.al::span" }
%"struct.std::array.58" = type { [16 x %struct.BFChannelConfig] }
%struct.BFChannelConfig = type { float, i32 }
%"class.al::span" = type { ptr, ptr }
%struct.RealMixParams = type { %"class.al::span.59", %"struct.std::array.60", %"class.al::span" }
%"class.al::span.59" = type { ptr, ptr }
%"struct.std::array.60" = type { [16 x i32] }
%"class.std::unique_ptr.61" = type { %"struct.std::__uniq_ptr_data.62" }
%"struct.std::__uniq_ptr_data.62" = type { %"class.std::__uniq_ptr_impl.63" }
%"class.std::__uniq_ptr_impl.63" = type { %"class.std::tuple.64" }
%"class.std::tuple.64" = type { %"struct.std::_Tuple_impl.65" }
%"struct.std::_Tuple_impl.65" = type { %"struct.std::_Head_base.68" }
%"struct.std::_Head_base.68" = type { ptr }
%"class.al::intrusive_ptr.69" = type { ptr }
%"class.std::unique_ptr.70" = type { %"struct.std::__uniq_ptr_data.71" }
%"struct.std::__uniq_ptr_data.71" = type { %"class.std::__uniq_ptr_impl.72" }
%"class.std::__uniq_ptr_impl.72" = type { %"class.std::tuple.73" }
%"class.std::tuple.73" = type { %"struct.std::_Tuple_impl.74" }
%"struct.std::_Tuple_impl.74" = type { %"struct.std::_Head_base.77" }
%"struct.std::_Head_base.77" = type { ptr }
%"class.std::unique_ptr.78" = type { %"struct.std::__uniq_ptr_data.79" }
%"struct.std::__uniq_ptr_data.79" = type { %"class.std::__uniq_ptr_impl.80" }
%"class.std::__uniq_ptr_impl.80" = type { %"class.std::tuple.81" }
%"class.std::tuple.81" = type { %"struct.std::_Tuple_impl.82" }
%"struct.std::_Tuple_impl.82" = type { %"struct.std::_Head_base.85" }
%"struct.std::_Head_base.85" = type { ptr }
%"class.std::unique_ptr.86" = type { %"struct.std::__uniq_ptr_data.87" }
%"struct.std::__uniq_ptr_data.87" = type { %"class.std::__uniq_ptr_impl.88" }
%"class.std::__uniq_ptr_impl.88" = type { %"class.std::tuple.89" }
%"class.std::tuple.89" = type { %"struct.std::_Tuple_impl.90" }
%"struct.std::_Tuple_impl.90" = type { %"struct.std::_Head_base.93" }
%"struct.std::_Head_base.93" = type { ptr }
%"class.std::unique_ptr.94" = type { %"struct.std::__uniq_ptr_data.95" }
%"struct.std::__uniq_ptr_data.95" = type { %"class.std::__uniq_ptr_impl.96" }
%"class.std::__uniq_ptr_impl.96" = type { %"class.std::tuple.97" }
%"class.std::tuple.97" = type { %"struct.std::_Tuple_impl.98" }
%"struct.std::_Tuple_impl.98" = type { %"struct.std::_Head_base.101" }
%"struct.std::_Head_base.101" = type { ptr }
%"class.std::unique_ptr.102" = type { %"struct.std::__uniq_ptr_data.103" }
%"struct.std::__uniq_ptr_data.103" = type { %"class.std::__uniq_ptr_impl.104" }
%"class.std::__uniq_ptr_impl.104" = type { %"class.std::tuple.105" }
%"class.std::tuple.105" = type { %"struct.std::_Tuple_impl.106" }
%"struct.std::_Tuple_impl.106" = type { %"struct.std::_Head_base.109" }
%"struct.std::_Head_base.109" = type { ptr }
%"struct.std::atomic.110" = type { %"struct.std::__atomic_base.111" }
%"struct.std::__atomic_base.111" = type { ptr }
%"class.std::unique_ptr.112" = type { %"struct.std::__uniq_ptr_data.113" }
%"struct.std::__uniq_ptr_data.113" = type { %"class.std::__uniq_ptr_impl.114" }
%"class.std::__uniq_ptr_impl.114" = type { %"class.std::tuple.115" }
%"class.std::tuple.115" = type { %"struct.std::_Tuple_impl.116" }
%"struct.std::_Tuple_impl.116" = type { %"struct.std::_Head_base.119" }
%"struct.std::_Head_base.119" = type { 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::vector.120" = type { %"struct.std::_Vector_base.121" }
%"struct.std::_Vector_base.121" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, al::allocator<std::__cxx11::basic_string<char>, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, al::allocator<std::__cxx11::basic_string<char>, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, al::allocator<std::__cxx11::basic_string<char>, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, al::allocator<std::__cxx11::basic_string<char>, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.124" = type { %"struct.std::_Vector_base.125" }
%"struct.std::_Vector_base.125" = type { %"struct.std::_Vector_base<BufferSubList, al::allocator<BufferSubList, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<BufferSubList, al::allocator<BufferSubList, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<BufferSubList, al::allocator<BufferSubList, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<BufferSubList, al::allocator<BufferSubList, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.128" = type { %"struct.std::_Vector_base.129" }
%"struct.std::_Vector_base.129" = type { %"struct.std::_Vector_base<EffectSubList, al::allocator<EffectSubList, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<EffectSubList, al::allocator<EffectSubList, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<EffectSubList, al::allocator<EffectSubList, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<EffectSubList, al::allocator<EffectSubList, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.132" = type { %"struct.std::_Vector_base.133" }
%"struct.std::_Vector_base.133" = type { %"struct.std::_Vector_base<FilterSubList, al::allocator<FilterSubList, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<FilterSubList, al::allocator<FilterSubList, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<FilterSubList, al::allocator<FilterSubList, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FilterSubList, al::allocator<FilterSubList, 8>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.ALfilter = type <{ i32, float, float, float, float, float, ptr, i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z12alGenFiltersiPj(i32 noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"class.al::intrusive_ptr", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::lock_guard", align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::vector.136", align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  invoke void @_Z13GetContextRefv(ptr dead_on_unwind writable sret(%"class.al::intrusive_ptr") align 8 %5)
          to label %16 unwind label %25

16:                                               ; preds = %2
  %17 = call noundef zeroext i1 @_ZNK2al13intrusive_ptrI10ALCcontextEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %18 = xor i1 %17, true
  %19 = xor i1 %18, true
  %20 = xor i1 %19, true
  %21 = zext i1 %20 to i64
  %22 = call i64 @llvm.expect.i64(i64 %21, i64 0)
  %23 = icmp ne i64 %22, 0
  br i1 %23, label %24, label %29

24:                                               ; preds = %16
  store i32 1, ptr %8, align 4
  br label %146

25:                                               ; preds = %2
  %26 = landingpad { ptr, i32 }
          catch ptr null
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %6, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %7, align 4
  br label %152

29:                                               ; preds = %16
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 0
  %32 = xor i1 %31, true
  %33 = xor i1 %32, true
  %34 = zext i1 %33 to i64
  %35 = call i64 @llvm.expect.i64(i64 %34, i64 0)
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %45

37:                                               ; preds = %29
  %38 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %39 = load i32, ptr %3, align 4, !tbaa !5
  invoke void (ptr, i32, ptr, ...) @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752) %38, i32 noundef 40963, ptr noundef @.str, i32 noundef %39)
          to label %40 unwind label %41

40:                                               ; preds = %37
  br label %45

41:                                               ; preds = %37
  %42 = landingpad { ptr, i32 }
          catch ptr null
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %6, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %7, align 4
  br label %151

45:                                               ; preds = %40, %29
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = icmp sle i32 %46, 0
  %48 = xor i1 %47, true
  %49 = xor i1 %48, true
  %50 = zext i1 %49 to i64
  %51 = call i64 @llvm.expect.i64(i64 %50, i64 0)
  %52 = icmp ne i64 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %45
  store i32 1, ptr %8, align 4
  br label %146

54:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %55 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %56 = getelementptr inbounds %struct.ALCcontext, ptr %55, i32 0, i32 3
  %57 = call noundef ptr @_ZNK2al13intrusive_ptrI9ALCdeviceE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %56) #7
  store ptr %57, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %58 = load ptr, ptr %9, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.ALCdevice, ptr %58, i32 0, i32 16
  invoke void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(40) %59)
          to label %60 unwind label %74

60:                                               ; preds = %54
  %61 = load ptr, ptr %9, align 8, !tbaa !9
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = zext i32 %62 to i64
  %64 = invoke noundef zeroext i1 @_ZN12_GLOBAL__N_113EnsureFiltersEP9ALCdevicem(ptr noundef %61, i64 noundef %63)
          to label %65 unwind label %78

65:                                               ; preds = %60
  br i1 %64, label %82, label %66

66:                                               ; preds = %65
  %67 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = icmp eq i32 %69, 1
  %71 = zext i1 %70 to i64
  %72 = select i1 %70, ptr @.str.2, ptr @.str.3
  invoke void (ptr, i32, ptr, ...) @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752) %67, i32 noundef 40965, ptr noundef @.str.1, i32 noundef %68, ptr noundef %72)
          to label %73 unwind label %78

73:                                               ; preds = %66
  store i32 1, ptr %8, align 4
  br label %145

74:                                               ; preds = %54
  %75 = landingpad { ptr, i32 }
          catch ptr null
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %6, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %7, align 4
  br label %150

78:                                               ; preds = %66, %60
  %79 = landingpad { ptr, i32 }
          catch ptr null
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %6, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %7, align 4
  br label %149

82:                                               ; preds = %65
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = icmp eq i32 %83, 1
  %85 = xor i1 %84, true
  %86 = xor i1 %85, true
  %87 = zext i1 %86 to i64
  %88 = call i64 @llvm.expect.i64(i64 %87, i64 1)
  %89 = icmp ne i64 %88, 0
  br i1 %89, label %90, label %107

90:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %91 = load ptr, ptr %9, align 8, !tbaa !9
  %92 = invoke noundef ptr @_ZN12_GLOBAL__N_111AllocFilterEP9ALCdevice(ptr noundef %91)
          to label %93 unwind label %102

93:                                               ; preds = %90
  store ptr %92, ptr %11, align 8, !tbaa !9
  %94 = load ptr, ptr %11, align 8, !tbaa !9
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %106

96:                                               ; preds = %93
  %97 = load ptr, ptr %11, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.ALfilter, ptr %97, i32 0, i32 7
  %99 = load i32, ptr %98, align 8, !tbaa !11
  %100 = load ptr, ptr %4, align 8, !tbaa !9
  %101 = getelementptr inbounds i32, ptr %100, i64 0
  store i32 %99, ptr %101, align 4, !tbaa !5
  br label %106

102:                                              ; preds = %90
  %103 = landingpad { ptr, i32 }
          catch ptr null
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %6, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %149

106:                                              ; preds = %96, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %144

107:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #7
  call void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %108 = load i32, ptr %3, align 4, !tbaa !5
  %109 = zext i32 %108 to i64
  invoke void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %109)
          to label %110 unwind label %135

110:                                              ; preds = %107
  br label %111

111:                                              ; preds = %119, %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %112 = load ptr, ptr %9, align 8, !tbaa !9
  %113 = invoke noundef ptr @_ZN12_GLOBAL__N_111AllocFilterEP9ALCdevice(ptr noundef %112)
          to label %114 unwind label %139

114:                                              ; preds = %111
  store ptr %113, ptr %13, align 8, !tbaa !9
  %115 = load ptr, ptr %13, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.ALfilter, ptr %115, i32 0, i32 7
  %117 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjN2al9allocatorIjLm4EEEE12emplace_backIJRjEEES5_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 4 dereferenceable(4) %116)
          to label %118 unwind label %139

118:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = add nsw i32 %120, -1
  store i32 %121, ptr %3, align 4, !tbaa !5
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %111, label %123, !llvm.loop !14

123:                                              ; preds = %119
  %124 = call ptr @_ZNSt6vectorIjN2al9allocatorIjLm4EEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %125 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  %126 = call ptr @_ZNSt6vectorIjN2al9allocatorIjLm4EEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %127 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %126, ptr %127, align 8
  %128 = load ptr, ptr %4, align 8, !tbaa !9
  %129 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8
  %133 = invoke noundef ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjN2al9allocatorIjLm4EEEEEES2_ET0_T_SA_S9_(ptr %130, ptr %132, ptr noundef %128)
          to label %134 unwind label %135

134:                                              ; preds = %123
  call void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  br label %144

135:                                              ; preds = %123, %107
  %136 = landingpad { ptr, i32 }
          catch ptr null
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %6, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %7, align 4
  br label %143

139:                                              ; preds = %114, %111
  %140 = landingpad { ptr, i32 }
          catch ptr null
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %6, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %143

143:                                              ; preds = %139, %135
  call void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  br label %149

144:                                              ; preds = %134, %106
  store i32 0, ptr %8, align 4
  br label %145

145:                                              ; preds = %144, %73
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %146

146:                                              ; preds = %145, %53, %24
  call void @_ZN2al13intrusive_ptrI10ALCcontextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %147 = load i32, ptr %8, align 4
  switch i32 %147, label %157 [
    i32 0, label %148
    i32 1, label %156
  ]

148:                                              ; preds = %146
  br label %156

149:                                              ; preds = %143, %102, %78
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %150

150:                                              ; preds = %149, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %151

151:                                              ; preds = %150, %41
  call void @_ZN2al13intrusive_ptrI10ALCcontextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br label %152

152:                                              ; preds = %151, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %6, align 8
  %155 = call ptr @__cxa_begin_catch(ptr %154) #7
  call void @_ZSt9terminatev() #8
  unreachable

156:                                              ; preds = %148, %146
  ret void

157:                                              ; preds = %146
  unreachable
}

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

declare void @_Z13GetContextRefv(ptr dead_on_unwind writable sret(%"class.al::intrusive_ptr") align 8) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK2al13intrusive_ptrI10ALCcontextEcvbEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

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

declare void @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752), i32 noundef, ptr noundef, ...) #2

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN12_GLOBAL__N_113EnsureFiltersEP9ALCdevicem(ptr noundef, i64 noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN12_GLOBAL__N_111AllocFilterEP9ALCdevice(ptr noundef) #4

; 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 void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjN2al9allocatorIjLm4EEEEEES2_ET0_T_SA_S9_(ptr, ptr, ptr noundef) #5

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

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

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

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

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

declare ptr @__cxa_begin_catch(ptr)

; Function Attrs: noreturn nounwind
declare void @_ZSt9terminatev() #6

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 = { inlinehint 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{!12, !6, i64 32}
!12 = !{!"_ZTS8ALfilter", !6, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !10, i64 24, !6, i64 32}
!13 = !{!"float", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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

%"class.al::intrusive_ptr" = type { ptr }
%"class.std::lock_guard" = type { ptr }
%"class.std::vector.136" = type { %"struct.std::_Vector_base.137" }
%"struct.std::_Vector_base.137" = type { %"struct.std::_Vector_base<unsigned int, al::allocator<unsigned int, 4>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, al::allocator<unsigned int, 4>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, al::allocator<unsigned int, 4>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, al::allocator<unsigned int, 4>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z12alGenFiltersiPj(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.al::intrusive_ptr", align 8
  %4 = alloca %"class.std::lock_guard", align 8
  %5 = alloca %"class.std::vector.136", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  invoke void @_Z13GetContextRefv(ptr dead_on_unwind nonnull writable sret(%"class.al::intrusive_ptr") align 8 %3)
          to label %6 unwind label %8

6:                                                ; preds = %2
  %7 = call noundef zeroext i1 @_ZNK2al13intrusive_ptrI10ALCcontextEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %7, label %10, label %.thread, !prof !5

8:                                                ; preds = %2
  %9 = landingpad { ptr, i32 }
          catch ptr null
  br label %66

10:                                               ; preds = %6
  %11 = icmp slt i32 %0, 0
  br i1 %11, label %12, label %16, !prof !6

12:                                               ; preds = %10
  %13 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  invoke void (ptr, i32, ptr, ...) @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752) %13, i32 noundef 40963, ptr noundef nonnull @.str, i32 noundef %0)
          to label %.thread unwind label %14

14:                                               ; preds = %12
  %15 = landingpad { ptr, i32 }
          catch ptr null
  br label %65

16:                                               ; preds = %10
  %17 = icmp eq i32 %0, 0
  br i1 %17, label %.thread, label %18, !prof !7

18:                                               ; preds = %16
  %19 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %20 = getelementptr inbounds i8, ptr %19, i64 368
  %21 = call noundef ptr @_ZNK2al13intrusive_ptrI9ALCdeviceE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %22 = getelementptr inbounds i8, ptr %21, i64 101384
  invoke void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(40) %22)
          to label %23 unwind label %31

23:                                               ; preds = %18
  %24 = zext nneg i32 %0 to i64
  %25 = invoke noundef zeroext i1 @_ZN12_GLOBAL__N_113EnsureFiltersEP9ALCdevicem(ptr noundef %21, i64 noundef %24)
          to label %26 unwind label %33

26:                                               ; preds = %23
  br i1 %25, label %35, label %27

27:                                               ; preds = %26
  %28 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %29 = icmp eq i32 %0, 1
  %30 = select i1 %29, ptr @.str.2, ptr @.str.3
  invoke void (ptr, i32, ptr, ...) @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752) %28, i32 noundef 40965, ptr noundef nonnull @.str.1, i32 noundef %0, ptr noundef nonnull %30)
          to label %62 unwind label %33

31:                                               ; preds = %18
  %32 = landingpad { ptr, i32 }
          catch ptr null
  br label %64

33:                                               ; preds = %27, %23
  %34 = landingpad { ptr, i32 }
          catch ptr null
  br label %63

35:                                               ; preds = %26
  %36 = icmp eq i32 %0, 1
  br i1 %36, label %37, label %45, !prof !5

37:                                               ; preds = %35
  %38 = invoke noundef ptr @_ZN12_GLOBAL__N_111AllocFilterEP9ALCdevice(ptr noundef %21)
          to label %39 unwind label %43

39:                                               ; preds = %37
  %.not25 = icmp eq ptr %38, null
  br i1 %.not25, label %62, label %40

40:                                               ; preds = %39
  %41 = getelementptr inbounds i8, ptr %38, i64 32
  %42 = load i32, ptr %41, align 8, !tbaa !8
  store i32 %42, ptr %1, align 4, !tbaa !15
  br label %62

43:                                               ; preds = %37
  %44 = landingpad { ptr, i32 }
          catch ptr null
  br label %63

45:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  invoke void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %24)
          to label %.preheader unwind label %57

.preheader:                                       ; preds = %45, %50
  %.0 = phi i32 [ %51, %50 ], [ %0, %45 ]
  %46 = invoke noundef ptr @_ZN12_GLOBAL__N_111AllocFilterEP9ALCdevice(ptr noundef %21)
          to label %47 unwind label %59

47:                                               ; preds = %.preheader
  %48 = getelementptr inbounds i8, ptr %46, i64 32
  %49 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjN2al9allocatorIjLm4EEEE12emplace_backIJRjEEES5_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %48)
          to label %50 unwind label %59

50:                                               ; preds = %47
  %51 = add nsw i32 %.0, -1
  %.not = icmp eq i32 %51, 0
  br i1 %.not, label %52, label %.preheader, !llvm.loop !16

52:                                               ; preds = %50
  %53 = call ptr @_ZNSt6vectorIjN2al9allocatorIjLm4EEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %54 = call ptr @_ZNSt6vectorIjN2al9allocatorIjLm4EEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %55 = invoke noundef ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjN2al9allocatorIjLm4EEEEEES2_ET0_T_SA_S9_(ptr %53, ptr %54, ptr noundef %1)
          to label %56 unwind label %57

56:                                               ; preds = %52
  call void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %62

57:                                               ; preds = %52, %45
  %58 = landingpad { ptr, i32 }
          catch ptr null
  br label %61

59:                                               ; preds = %47, %.preheader
  %60 = landingpad { ptr, i32 }
          catch ptr null
  br label %61

61:                                               ; preds = %59, %57
  %.pn = phi { ptr, i32 } [ %58, %57 ], [ %60, %59 ]
  call void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %63

62:                                               ; preds = %56, %40, %39, %27
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %.thread

.thread:                                          ; preds = %12, %16, %6, %62
  call void @_ZN2al13intrusive_ptrI10ALCcontextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret void

63:                                               ; preds = %61, %43, %33
  %.pn24 = phi { ptr, i32 } [ %44, %43 ], [ %.pn, %61 ], [ %34, %33 ]
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %64

64:                                               ; preds = %63, %31
  %.pn24.pn = phi { ptr, i32 } [ %.pn24, %63 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %65

65:                                               ; preds = %64, %14
  %.pn24.pn.pn = phi { ptr, i32 } [ %.pn24.pn, %64 ], [ %15, %14 ]
  call void @_ZN2al13intrusive_ptrI10ALCcontextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br label %66

66:                                               ; preds = %65, %8
  %.pn24.pn.pn.pn = phi { ptr, i32 } [ %.pn24.pn.pn, %65 ], [ %9, %8 ]
  %.4 = extractvalue { ptr, i32 } %.pn24.pn.pn.pn, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %67 = call ptr @__cxa_begin_catch(ptr %.4) #6
  call void @_ZSt9terminatev() #7
  unreachable
}

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

declare void @_Z13GetContextRefv(ptr dead_on_unwind writable sret(%"class.al::intrusive_ptr") align 8) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK2al13intrusive_ptrI10ALCcontextEcvbEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

declare void @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752), i32 noundef, ptr noundef, ...) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN12_GLOBAL__N_113EnsureFiltersEP9ALCdevicem(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN12_GLOBAL__N_111AllocFilterEP9ALCdevice(ptr noundef) local_unnamed_addr #3

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIjN2al9allocatorIjLm4EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjN2al9allocatorIjLm4EEEEEES2_ET0_T_SA_S9_(ptr, ptr, ptr noundef) local_unnamed_addr #4

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

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

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

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

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

; Function Attrs: noreturn nounwind
declare void @_ZSt9terminatev() local_unnamed_addr #5

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { inlinehint 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 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!6 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!7 = !{!"branch_weights", !"expected", i32 1, i32 2147483647}
!8 = !{!9, !10, i64 32}
!9 = !{!"_ZTS8ALfilter", !10, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !14, i64 24, !10, i64 32}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"float", !11, i64 0}
!14 = !{!"any pointer", !11, i64 0}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass