; LLVM IR from kacperks/Fractal_Engine :: Engine/Thirdparty/cmake/Engine/Thirdparty/cmake/openal-soft/alc/backends/oss_489cbc0f (ZN17OSSBackendFactory5probeB5cxx11E11BackendType)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<(anonymous namespace)::DevMap, al::allocator<(anonymous namespace)::DevMap, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<(anonymous namespace)::DevMap, al::allocator<(anonymous namespace)::DevMap, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<(anonymous namespace)::DevMap, al::allocator<(anonymous namespace)::DevMap, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<(anonymous namespace)::DevMap, al::allocator<(anonymous namespace)::DevMap, 8>>::_Vector_impl_data" = type { ptr, ptr, 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.anon = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZN12_GLOBAL__N_115PlaybackDevicesE = external hidden global %"class.std::vector", align 8
@_ZN12_GLOBAL__N_114CaptureDevicesE = external hidden global %"class.std::vector", align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17OSSBackendFactory5probeB5cxx11E11BackendType(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i1, align 1
  %8 = alloca %class.anon, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %class.anon, align 8
  %14 = alloca %class.anon, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %class.anon, align 8
  %18 = alloca %class.anon, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %19 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %20 = getelementptr inbounds %class.anon, ptr %8, i32 0, i32 0
  store ptr %0, ptr %20, align 8, !tbaa !5
  %21 = load i32, ptr %6, align 4, !tbaa !9
  switch i32 %21, label %56 [
    i32 0, label %22
    i32 1, label %41
  ]

22:                                               ; preds = %3
  call void @_ZNSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_115PlaybackDevicesE) #4
  invoke void @_ZN12_GLOBAL__N_118ALCossListPopulateERSt6vectorINS_6DevMapEN2al9allocatorIS1_Lm8EEEEi(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_115PlaybackDevicesE, i32 noundef 131072)
          to label %23 unwind label %37

23:                                               ; preds = %22
  %24 = call ptr @_ZNKSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE6cbeginEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_115PlaybackDevicesE) #4
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  %26 = call ptr @_ZNKSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE4cendEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_115PlaybackDevicesE) #4
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !11
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8
  %32 = getelementptr inbounds %class.anon, ptr %13, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8
  %34 = invoke ptr @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPKN12_GLOBAL__N_16DevMapESt6vectorIS3_N2al9allocatorIS3_Lm8EEEEEEZN17OSSBackendFactory5probeB5cxx11E11BackendTypeE3$_0ET0_T_SG_SF_"(ptr %29, ptr %31, ptr %33)
          to label %35 unwind label %37

35:                                               ; preds = %23
  %36 = getelementptr inbounds %class.anon, ptr %14, i32 0, i32 0
  store ptr %34, ptr %36, align 8
  br label %56

37:                                               ; preds = %42, %41, %23, %22
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %9, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %60

41:                                               ; preds = %3
  call void @_ZNSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_114CaptureDevicesE) #4
  invoke void @_ZN12_GLOBAL__N_118ALCossListPopulateERSt6vectorINS_6DevMapEN2al9allocatorIS1_Lm8EEEEi(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_114CaptureDevicesE, i32 noundef 65536)
          to label %42 unwind label %37

42:                                               ; preds = %41
  %43 = call ptr @_ZNKSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE6cbeginEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_114CaptureDevicesE) #4
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %43, ptr %44, align 8
  %45 = call ptr @_ZNKSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE4cendEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_114CaptureDevicesE) #4
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !11
  %47 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8
  %51 = getelementptr inbounds %class.anon, ptr %17, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8
  %53 = invoke ptr @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPKN12_GLOBAL__N_16DevMapESt6vectorIS3_N2al9allocatorIS3_Lm8EEEEEEZN17OSSBackendFactory5probeB5cxx11E11BackendTypeE3$_0ET0_T_SG_SF_"(ptr %48, ptr %50, ptr %52)
          to label %54 unwind label %37

54:                                               ; preds = %42
  %55 = getelementptr inbounds %class.anon, ptr %18, i32 0, i32 0
  store ptr %53, ptr %55, align 8
  br label %56

56:                                               ; preds = %54, %35, %3
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %57 = load i1, ptr %7, align 1
  br i1 %57, label %59, label %58

58:                                               ; preds = %56
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %59

59:                                               ; preds = %58, %56
  ret void

60:                                               ; preds = %37
  %61 = load ptr, ptr %9, align 8
  %62 = load i32, ptr %10, align 4
  %63 = insertvalue { ptr, i32 } poison, ptr %61, 0
  %64 = insertvalue { ptr, i32 } %63, i32 %62, 1
  resume { ptr, i32 } %64
}

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZNSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_118ALCossListPopulateERSt6vectorINS_6DevMapEN2al9allocatorIS1_Lm8EEEEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPKN12_GLOBAL__N_16DevMapESt6vectorIS3_N2al9allocatorIS3_Lm8EEEEEEZN17OSSBackendFactory5probeB5cxx11E11BackendTypeE3$_0ET0_T_SG_SF_"(ptr, ptr, ptr) #2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!"_ZTS11BackendType", !7, i64 0}
!11 = !{i64 0, i64 8, !5}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<(anonymous namespace)::DevMap, al::allocator<(anonymous namespace)::DevMap, 8>>::_Vector_impl" }
%"struct.std::_Vector_base<(anonymous namespace)::DevMap, al::allocator<(anonymous namespace)::DevMap, 8>>::_Vector_impl" = type { %"struct.std::_Vector_base<(anonymous namespace)::DevMap, al::allocator<(anonymous namespace)::DevMap, 8>>::_Vector_impl_data" }
%"struct.std::_Vector_base<(anonymous namespace)::DevMap, al::allocator<(anonymous namespace)::DevMap, 8>>::_Vector_impl_data" = type { ptr, ptr, 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] }

@_ZN12_GLOBAL__N_115PlaybackDevicesE = external hidden global %"class.std::vector", align 8
@_ZN12_GLOBAL__N_114CaptureDevicesE = external hidden global %"class.std::vector", align 8

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17OSSBackendFactory5probeB5cxx11E11BackendType(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %1, i32 noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #2
  switch i32 %2, label %11 [
    i32 0, label %4
    i32 1, label %7
  ]

4:                                                ; preds = %3
  tail call void @_ZNSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_115PlaybackDevicesE) #2
  invoke void @_ZN12_GLOBAL__N_118ALCossListPopulateERSt6vectorINS_6DevMapEN2al9allocatorIS1_Lm8EEEEi(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_115PlaybackDevicesE, i32 noundef 131072)
          to label %.invoke unwind label %5

5:                                                ; preds = %.invoke, %7, %4
  %6 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #2
  resume { ptr, i32 } %6

7:                                                ; preds = %3
  tail call void @_ZNSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_114CaptureDevicesE) #2
  invoke void @_ZN12_GLOBAL__N_118ALCossListPopulateERSt6vectorINS_6DevMapEN2al9allocatorIS1_Lm8EEEEi(ptr noundef nonnull align 8 dereferenceable(24) @_ZN12_GLOBAL__N_114CaptureDevicesE, i32 noundef 65536)
          to label %.invoke unwind label %5

.invoke:                                          ; preds = %7, %4
  %_ZN12_GLOBAL__N_115PlaybackDevicesE.sink12 = phi ptr [ @_ZN12_GLOBAL__N_115PlaybackDevicesE, %4 ], [ @_ZN12_GLOBAL__N_114CaptureDevicesE, %7 ]
  %8 = tail call ptr @_ZNKSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE6cbeginEv(ptr noundef nonnull align 8 dereferenceable(24) %_ZN12_GLOBAL__N_115PlaybackDevicesE.sink12) #2
  %9 = tail call ptr @_ZNKSt6vectorIN12_GLOBAL__N_16DevMapEN2al9allocatorIS1_Lm8EEEE4cendEv(ptr noundef nonnull align 8 dereferenceable(24) %_ZN12_GLOBAL__N_115PlaybackDevicesE.sink12) #2
  %10 = invoke ptr @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPKN12_GLOBAL__N_16DevMapESt6vectorIS3_N2al9allocatorIS3_Lm8EEEEEEZN17OSSBackendFactory5probeB5cxx11E11BackendTypeE3$_0ET0_T_SG_SF_"(ptr %8, ptr %9, ptr nonnull %0)
          to label %11 unwind label %5

11:                                               ; preds = %.invoke, %3
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_118ALCossListPopulateERSt6vectorINS_6DevMapEN2al9allocatorIS1_Lm8EEEEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPKN12_GLOBAL__N_16DevMapESt6vectorIS3_N2al9allocatorIS3_Lm8EEEEEEZN17OSSBackendFactory5probeB5cxx11E11BackendTypeE3$_0ET0_T_SG_SF_"(ptr, ptr, ptr) local_unnamed_addr #1

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass