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

; 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 }
%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 }

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @alListenerf(i32 noundef %0, float noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca float, align 4
  %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
  store i32 %0, ptr %3, align 4, !tbaa !5
  store float %1, ptr %4, align 4, !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 %11 unwind label %20

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

19:                                               ; preds = %11
  store i32 1, ptr %8, align 4
  br label %103

20:                                               ; preds = %2
  %21 = landingpad { ptr, i32 }
          catch ptr null
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %6, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %7, align 4
  br label %107

24:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %25 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %26 = getelementptr inbounds %struct.ALCcontext, ptr %25, i32 0, i32 17
  store ptr %26, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %27 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %28 = getelementptr inbounds %struct.ALCcontext, ptr %27, i32 0, i32 7
  invoke void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(40) %28)
          to label %29 unwind label %31

29:                                               ; preds = %24
  %30 = load i32, ptr %3, align 4, !tbaa !5
  switch i32 %30, label %98 [
    i32 4106, label %35
    i32 131076, label %69
  ]

31:                                               ; preds = %24
  %32 = landingpad { ptr, i32 }
          catch ptr null
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %6, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %7, align 4
  br label %106

35:                                               ; preds = %29
  %36 = load float, ptr %4, align 4, !tbaa !9
  %37 = fcmp oge float %36, 0.000000e+00
  br i1 %37, label %38, label %42

38:                                               ; preds = %35
  %39 = load float, ptr %4, align 4, !tbaa !9
  %40 = invoke noundef zeroext i1 @_ZSt8isfinitef(float noundef %39)
          to label %41 unwind label %46

41:                                               ; preds = %38
  br i1 %40, label %52, label %42

42:                                               ; preds = %41, %35
  br label %43

43:                                               ; preds = %42
  %44 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  invoke void (ptr, i32, ptr, ...) @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752) %44, i32 noundef 40963, ptr noundef @.str)
          to label %45 unwind label %46

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

46:                                               ; preds = %98, %89, %76, %60, %43, %38
  %47 = landingpad { ptr, i32 }
          catch ptr null
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %6, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %7, align 4
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %106

50:                                               ; No predecessors!
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51, %41
  %53 = load float, ptr %4, align 4, !tbaa !9
  %54 = load ptr, ptr %9, align 8, !tbaa !11
  %55 = getelementptr inbounds %struct.ALlistener, ptr %54, i32 0, i32 4
  store float %53, ptr %55, align 4, !tbaa !13
  br label %56

56:                                               ; preds = %52
  %57 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %58 = getelementptr inbounds %struct.ALCcontext, ptr %57, i32 0, i32 6
  %59 = call noundef zeroext i1 @_ZNKSt6atomicIbE4loadESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1) %58, i32 noundef 2) #7
  br i1 %59, label %63, label %60

60:                                               ; preds = %56
  %61 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  invoke void @_Z19UpdateListenerPropsP10ALCcontext(ptr noundef %61)
          to label %62 unwind label %46

62:                                               ; preds = %60
  br label %66

63:                                               ; preds = %56
  %64 = load ptr, ptr %9, align 8, !tbaa !11
  %65 = getelementptr inbounds %struct.ALlistener, ptr %64, i32 0, i32 6
  call void @_ZN2al14atomic_invflag3setESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1) %65, i32 noundef 3) #7
  br label %66

66:                                               ; preds = %63, %62
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  br label %101

69:                                               ; preds = %29
  %70 = load float, ptr %4, align 4, !tbaa !9
  %71 = fcmp oge float %70, 0x3810000000000000
  br i1 %71, label %72, label %75

72:                                               ; preds = %69
  %73 = load float, ptr %4, align 4, !tbaa !9
  %74 = fcmp ole float %73, 0x47EFFFFFE0000000
  br i1 %74, label %81, label %75

75:                                               ; preds = %72, %69
  br label %76

76:                                               ; preds = %75
  %77 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  invoke void (ptr, i32, ptr, ...) @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752) %77, i32 noundef 40963, ptr noundef @.str.1)
          to label %78 unwind label %46

78:                                               ; preds = %76
  store i32 1, ptr %8, align 4
  br label %102

79:                                               ; No predecessors!
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80, %72
  %82 = load float, ptr %4, align 4, !tbaa !9
  %83 = load ptr, ptr %9, align 8, !tbaa !11
  %84 = getelementptr inbounds %struct.ALlistener, ptr %83, i32 0, i32 5
  store float %82, ptr %84, align 4, !tbaa !20
  br label %85

85:                                               ; preds = %81
  %86 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %87 = getelementptr inbounds %struct.ALCcontext, ptr %86, i32 0, i32 6
  %88 = call noundef zeroext i1 @_ZNKSt6atomicIbE4loadESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1) %87, i32 noundef 2) #7
  br i1 %88, label %92, label %89

89:                                               ; preds = %85
  %90 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  invoke void @_Z19UpdateListenerPropsP10ALCcontext(ptr noundef %90)
          to label %91 unwind label %46

91:                                               ; preds = %89
  br label %95

92:                                               ; preds = %85
  %93 = load ptr, ptr %9, align 8, !tbaa !11
  %94 = getelementptr inbounds %struct.ALlistener, ptr %93, i32 0, i32 6
  call void @_ZN2al14atomic_invflag3setESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1) %94, i32 noundef 3) #7
  br label %95

95:                                               ; preds = %92, %91
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  br label %101

98:                                               ; preds = %29
  %99 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  invoke void (ptr, i32, ptr, ...) @_ZN10ALCcontext8setErrorEiPKcz(ptr noundef nonnull align 16 dereferenceable(752) %99, i32 noundef 40962, ptr noundef @.str.2)
          to label %100 unwind label %46

100:                                              ; preds = %98
  br label %101

101:                                              ; preds = %100, %97, %68
  store i32 0, ptr %8, align 4
  br label %102

102:                                              ; preds = %101, %78, %45
  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 %103

103:                                              ; preds = %102, %19
  call void @_ZN2al13intrusive_ptrI10ALCcontextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %104 = load i32, ptr %8, align 4
  switch i32 %104, label %112 [
    i32 0, label %105
    i32 1, label %111
  ]

105:                                              ; preds = %103
  br label %111

106:                                              ; preds = %46, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZN2al13intrusive_ptrI10ALCcontextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br label %107

107:                                              ; preds = %106, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr %6, align 8
  %110 = call ptr @__cxa_begin_catch(ptr %109) #7
  call void @_ZSt9terminatev() #8
  unreachable

111:                                              ; preds = %105, %103
  ret void

112:                                              ; preds = %103
  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

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinitef(float noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6atomicIbE4loadESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z19UpdateListenerPropsP10ALCcontext(ptr noundef) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2al14atomic_invflag3setESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef) #5 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: 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 @_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 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 #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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !10, i64 48}
!14 = !{!"_ZTS10ALlistener", !15, i64 0, !15, i64 12, !15, i64 24, !15, i64 36, !10, i64 48, !10, i64 52, !16, i64 56}
!15 = !{!"_ZTSSt5arrayIfLm3EE", !7, i64 0}
!16 = !{!"_ZTSN2al14atomic_invflagE", !17, i64 0}
!17 = !{!"_ZTSSt11atomic_flag", !18, i64 0}
!18 = !{!"_ZTSSt18__atomic_flag_base", !19, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!14, !10, i64 52}


; 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 }

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @alListenerf(i32 noundef %0, float 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
  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 %5 unwind label %7

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

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

9:                                                ; preds = %5
  %10 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %11 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %12 = getelementptr inbounds i8, ptr %11, i64 408
  invoke void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(40) %12)
          to label %13 unwind label %14

13:                                               ; preds = %9
  switch i32 %0, label %.invoke [
    i32 4106, label %16
    i32 131076, label %27
  ]

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

16:                                               ; preds = %13
  %17 = fcmp ult float %1, 0.000000e+00
  br i1 %17, label %.invoke, label %18

18:                                               ; preds = %16
  %19 = call noundef zeroext i1 @_ZSt8isfinitef(float noundef %1)
  br i1 %19, label %22, label %.invoke

20:                                               ; preds = %.invoke14, %.invoke
  %21 = landingpad { ptr, i32 }
          catch ptr null
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %42

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %10, i64 576
  store float %1, ptr %23, align 4, !tbaa !6
  %24 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %25 = getelementptr inbounds i8, ptr %24, i64 401
  %26 = call noundef zeroext i1 @_ZNKSt6atomicIbE4loadESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1) %25, i32 noundef 2) #6
  br i1 %26, label %.sink.split, label %.invoke14

27:                                               ; preds = %13
  %28 = fcmp oge float %1, 0x3810000000000000
  %29 = fcmp ole float %1, 0x47EFFFFFE0000000
  %or.cond = and i1 %28, %29
  br i1 %or.cond, label %30, label %.invoke

30:                                               ; preds = %27
  %31 = getelementptr inbounds i8, ptr %10, i64 580
  store float %1, ptr %31, align 4, !tbaa !16
  %32 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %33 = getelementptr inbounds i8, ptr %32, i64 401
  %34 = call noundef zeroext i1 @_ZNKSt6atomicIbE4loadESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1) %33, i32 noundef 2) #6
  br i1 %34, label %.sink.split, label %.invoke14

.invoke14:                                        ; preds = %30, %22
  %35 = call noundef ptr @_ZNK2al13intrusive_ptrI10ALCcontextE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  invoke void @_Z19UpdateListenerPropsP10ALCcontext(ptr noundef %35)
          to label %40 unwind label %20

.invoke:                                          ; preds = %13, %27, %18, %16
  %36 = phi i32 [ 40963, %16 ], [ 40963, %18 ], [ 40963, %27 ], [ 40962, %13 ]
  %37 = phi ptr [ @.str, %16 ], [ @.str, %18 ], [ @.str.1, %27 ], [ @.str.2, %13 ]
  %38 = 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) %38, i32 noundef %36, ptr noundef nonnull %37)
          to label %40 unwind label %20

.sink.split:                                      ; preds = %30, %22
  %39 = getelementptr inbounds i8, ptr %10, i64 584
  call void @_ZN2al14atomic_invflag3setESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1) %39, i32 noundef 3) #6
  br label %40

40:                                               ; preds = %.sink.split, %.invoke14, %.invoke
  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 %41

41:                                               ; preds = %5, %40
  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

42:                                               ; preds = %20, %14
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN2al13intrusive_ptrI10ALCcontextED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br label %43

43:                                               ; preds = %42, %7
  %.pn.pn = phi { ptr, i32 } [ %.pn, %42 ], [ %8, %7 ]
  %.1 = extractvalue { ptr, i32 } %.pn.pn, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %44 = call ptr @__cxa_begin_catch(ptr %.1) #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

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinitef(float noundef) local_unnamed_addr #0

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 zeroext i1 @_ZNKSt6atomicIbE4loadESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z19UpdateListenerPropsP10ALCcontext(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2al14atomic_invflag3setESt12memory_order(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef) local_unnamed_addr #4 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 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 @_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 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 #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 = !{!7, !11, i64 48}
!7 = !{!"_ZTS10ALlistener", !8, i64 0, !8, i64 12, !8, i64 24, !8, i64 36, !11, i64 48, !11, i64 52, !12, i64 56}
!8 = !{!"_ZTSSt5arrayIfLm3EE", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"_ZTSN2al14atomic_invflagE", !13, i64 0}
!13 = !{!"_ZTSSt11atomic_flag", !14, i64 0}
!14 = !{!"_ZTSSt18__atomic_flag_base", !15, i64 0}
!15 = !{!"bool", !9, i64 0}
!16 = !{!7, !11, i64 52}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass