; LLVM IR from SelfishOlex/MiniAudioO3DE :: MiniAudio/Code/Source/Clients (MiniAudioImplementation)

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

%struct.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.ma_device = type { ptr, i32, i32, i32, ptr, ptr, ptr, ptr, %union.pthread_mutex_t, %struct.ma_event, %struct.ma_event, %struct.ma_event, i64, i32, i8, i8, i8, i8, i8, float, %struct.ma_duplex_rb, %struct.anon.24, %struct.anon.26, %struct.anon.31, %union.anon.32 }
%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 }
%struct.ma_event = type { i32, %union.pthread_mutex_t, %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%struct.ma_duplex_rb = type { %struct.ma_pcm_rb }
%struct.ma_pcm_rb = type { %struct.ma_rb, i32, i32 }
%struct.ma_rb = type { ptr, i32, i32, i32, i32, i32, i8, i8, %struct.ma_allocation_callbacks }
%struct.anon.24 = type { i32, ptr, ptr, %struct.anon.25 }
%struct.anon.25 = type { i32 }
%struct.anon.26 = type { ptr, %union.ma_device_id, [256 x i8], i32, i32, i32, [254 x i8], i32, i32, i32, [254 x i8], i32, i32, i32, %struct.ma_data_converter, ptr, i32, i32, ptr, i64, i64, i64 }
%union.ma_device_id = type { %union.anon.17 }
%union.anon.17 = type { ptr, [248 x i8] }
%struct.ma_data_converter = type { i32, i32, i32, i32, i32, i32, i32, i32, %struct.ma_channel_converter, %struct.ma_resampler, i8, i8, i8, i8, i8, i8, ptr }
%struct.ma_channel_converter = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, %union.anon.27, ptr, i32 }
%union.anon.27 = type { ptr }
%struct.ma_resampler = type { ptr, ptr, ptr, i32, i32, i32, i32, %union.anon.28, ptr, i32 }
%union.anon.28 = type { %struct.ma_linear_resampler }
%struct.ma_linear_resampler = type { %struct.ma_linear_resampler_config, i32, i32, i32, i32, %union.anon.29, %union.anon.30, %struct.ma_lpf, ptr, i32 }
%struct.ma_linear_resampler_config = type { i32, i32, i32, i32, i32, double }
%union.anon.29 = type { ptr }
%union.anon.30 = type { ptr }
%struct.ma_lpf = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, i32 }
%struct.anon.31 = type { ptr, %union.ma_device_id, [256 x i8], i32, i32, i32, [254 x i8], i32, i32, i32, [254 x i8], i32, i32, i32, %struct.ma_data_converter, ptr, i32, i32 }
%union.anon.32 = type { %struct.anon.36 }
%struct.anon.36 = type { i64, %struct.ma_event, %struct.ma_event, %struct.ma_semaphore, i32, i32, %union.ma_timer, double, i32, i32, i64, i64, i32 }
%struct.ma_semaphore = type { i32, %union.pthread_mutex_t, %union.pthread_cond_t }
%union.ma_timer = type { i64 }
%struct.ma_context = type { %struct.ma_backend_callbacks, i32, ptr, %struct.ma_log, i32, i64, ptr, %struct.ma_allocation_callbacks, %union.pthread_mutex_t, %union.pthread_mutex_t, i32, i32, i32, ptr, %union.anon.41, %union.anon.46 }
%struct.ma_backend_callbacks = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ma_log = type { [4 x %struct.ma_log_callback], i32, %struct.ma_allocation_callbacks, %union.pthread_mutex_t }
%struct.ma_log_callback = type { ptr, ptr }
%union.anon.41 = type { %struct.anon.42 }
%struct.anon.42 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %union.pthread_mutex_t, i32 }
%union.anon.46 = type { %struct.anon.47 }
%struct.anon.47 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @ma_free(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @ma_mutex_uninit(ptr noundef) #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

; Function Attrs: mustprogress uwtable
declare dso_local void @ma_event_uninit(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_event_signal(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14ma_thread_waitPm(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_context_uninit(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @ma_device_uninit(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.ma_allocation_callbacks, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = call noundef i32 @_ZL25ma_device__is_initializedP9ma_device(ptr noundef %4)
  %6 = icmp ne i32 %5, 0
  br i1 %6, label %8, label %7

7:                                                ; preds = %1
  br label %174

8:                                                ; preds = %1
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = call i32 @ma_device_is_started(ptr noundef %9)
  %11 = icmp ne i32 %10, 0
  br i1 %11, label %12, label %15

12:                                               ; preds = %8
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = call i32 @ma_device_stop(ptr noundef %13)
  br label %15

15:                                               ; preds = %12, %8
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZL20ma_device__set_stateP9ma_device15ma_device_state(ptr noundef %16, i32 noundef 0)
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ma_device, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = call noundef i32 @_ZL34ma_context_is_backend_asynchronousP10ma_context(ptr noundef %19)
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %28, label %22

22:                                               ; preds = %15
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ma_device, ptr %23, i32 0, i32 9
  %25 = call i32 @ma_event_signal(ptr noundef %24)
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ma_device, ptr %26, i32 0, i32 12
  call void @_ZL14ma_thread_waitPm(ptr noundef %27)
  br label %28

28:                                               ; preds = %22, %15
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ma_device, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.ma_context, ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds %struct.ma_backend_callbacks, ptr %32, i32 0, i32 5
  %34 = load ptr, ptr %33, align 8, !tbaa !37
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %45

36:                                               ; preds = %28
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ma_device, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.ma_context, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %struct.ma_backend_callbacks, ptr %40, i32 0, i32 5
  %42 = load ptr, ptr %41, align 8, !tbaa !37
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = call noundef i32 %42(ptr noundef %43)
  br label %45

45:                                               ; preds = %36, %28
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ma_device, ptr %46, i32 0, i32 11
  call void @ma_event_uninit(ptr noundef %47)
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ma_device, ptr %48, i32 0, i32 10
  call void @ma_event_uninit(ptr noundef %49)
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ma_device, ptr %50, i32 0, i32 9
  call void @ma_event_uninit(ptr noundef %51)
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ma_device, ptr %52, i32 0, i32 8
  call void @ma_mutex_uninit(ptr noundef %53)
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ma_device, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = call noundef i32 @_ZL34ma_context_is_backend_asynchronousP10ma_context(ptr noundef %56)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %69

59:                                               ; preds = %45
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.ma_device, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 8, !tbaa !43
  %63 = icmp eq i32 %62, 3
  br i1 %63, label %64, label %68

64:                                               ; preds = %59
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ma_device, ptr %65, i32 0, i32 20
  %67 = call i32 @ma_duplex_rb_uninit(ptr noundef %66)
  br label %68

68:                                               ; preds = %64, %59
  br label %69

69:                                               ; preds = %68, %45
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ma_device, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !43
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %84, label %74

74:                                               ; preds = %69
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ma_device, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 8, !tbaa !43
  %78 = icmp eq i32 %77, 3
  br i1 %78, label %84, label %79

79:                                               ; preds = %74
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ma_device, ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 8, !tbaa !43
  %83 = icmp eq i32 %82, 4
  br i1 %83, label %84, label %92

84:                                               ; preds = %79, %74, %69
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ma_device, ptr %85, i32 0, i32 23
  %87 = getelementptr inbounds %struct.anon.31, ptr %86, i32 0, i32 14
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ma_device, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.ma_context, ptr %90, i32 0, i32 7
  call void @ma_data_converter_uninit(ptr noundef %87, ptr noundef %91)
  br label %92

92:                                               ; preds = %84, %79
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ma_device, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 8, !tbaa !43
  %96 = icmp eq i32 %95, 1
  br i1 %96, label %102, label %97

97:                                               ; preds = %92
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ma_device, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 8, !tbaa !43
  %101 = icmp eq i32 %100, 3
  br i1 %101, label %102, label %110

102:                                              ; preds = %97, %92
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ma_device, ptr %103, i32 0, i32 22
  %105 = getelementptr inbounds %struct.anon.26, ptr %104, i32 0, i32 14
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ma_device, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !9
  %109 = getelementptr inbounds %struct.ma_context, ptr %108, i32 0, i32 7
  call void @ma_data_converter_uninit(ptr noundef %105, ptr noundef %109)
  br label %110

110:                                              ; preds = %102, %97
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ma_device, ptr %111, i32 0, i32 22
  %113 = getelementptr inbounds %struct.anon.26, ptr %112, i32 0, i32 18
  %114 = load ptr, ptr %113, align 8, !tbaa !44
  %115 = icmp ne ptr %114, null
  br i1 %115, label %116, label %125

116:                                              ; preds = %110
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.ma_device, ptr %117, i32 0, i32 22
  %119 = getelementptr inbounds %struct.anon.26, ptr %118, i32 0, i32 18
  %120 = load ptr, ptr %119, align 8, !tbaa !44
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.ma_device, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.ma_context, ptr %123, i32 0, i32 7
  call void @ma_free(ptr noundef %120, ptr noundef %124)
  br label %125

125:                                              ; preds = %116, %110
  %126 = load ptr, ptr %2, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.ma_device, ptr %126, i32 0, i32 23
  %128 = getelementptr inbounds %struct.anon.31, ptr %127, i32 0, i32 15
  %129 = load ptr, ptr %128, align 8, !tbaa !45
  %130 = icmp ne ptr %129, null
  br i1 %130, label %131, label %140

131:                                              ; preds = %125
  %132 = load ptr, ptr %2, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.ma_device, ptr %132, i32 0, i32 23
  %134 = getelementptr inbounds %struct.anon.31, ptr %133, i32 0, i32 15
  %135 = load ptr, ptr %134, align 8, !tbaa !45
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.ma_device, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = getelementptr inbounds %struct.ma_context, ptr %138, i32 0, i32 7
  call void @ma_free(ptr noundef %135, ptr noundef %139)
  br label %140

140:                                              ; preds = %131, %125
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.ma_device, ptr %141, i32 0, i32 22
  %143 = getelementptr inbounds %struct.anon.26, ptr %142, i32 0, i32 15
  %144 = load ptr, ptr %143, align 8, !tbaa !46
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %155

146:                                              ; preds = %140
  %147 = load ptr, ptr %2, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ma_device, ptr %147, i32 0, i32 22
  %149 = getelementptr inbounds %struct.anon.26, ptr %148, i32 0, i32 15
  %150 = load ptr, ptr %149, align 8, !tbaa !46
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.ma_device, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.ma_context, ptr %153, i32 0, i32 7
  call void @ma_free(ptr noundef %150, ptr noundef %154)
  br label %155

155:                                              ; preds = %146, %140
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.ma_device, ptr %156, i32 0, i32 14
  %158 = load i8, ptr %157, align 4, !tbaa !47
  %159 = icmp ne i8 %158, 0
  br i1 %159, label %160, label %172

160:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #6
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.ma_device, ptr %161, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = getelementptr inbounds %struct.ma_context, ptr %163, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %164, i64 32, i1 false), !tbaa.struct !48
  %165 = load ptr, ptr %2, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.ma_device, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !9
  %168 = call i32 @ma_context_uninit(ptr noundef %167)
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.ma_device, ptr %169, i32 0, i32 0
  %171 = load ptr, ptr %170, align 8, !tbaa !9
  call void @ma_free(ptr noundef %171, ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  br label %172

172:                                              ; preds = %160, %155
  %173 = load ptr, ptr %2, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %173, i8 0, i64 3696, i1 false)
  br label %174

174:                                              ; preds = %172, %7
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL34ma_context_is_backend_asynchronousP10ma_context(ptr noundef) #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @_ZL20ma_device__set_stateP9ma_device15ma_device_state(ptr noundef, i32 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL25ma_device__is_initializedP9ma_device(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_device_is_started(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_device_stop(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_duplex_rb_uninit(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @ma_data_converter_uninit(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = { alwaysinline 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 = { 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, !6, i64 0}
!10 = !{!"_ZTS9ma_device", !6, i64 0, !11, i64 8, !12, i64 12, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !14, i64 96, !14, i64 192, !14, i64 288, !15, i64 384, !16, i64 392, !7, i64 396, !7, i64 397, !7, i64 398, !7, i64 399, !7, i64 400, !17, i64 404, !18, i64 408, !23, i64 480, !26, i64 512, !36, i64 1944, !7, i64 3344}
!11 = !{!"_ZTS14ma_device_type", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS15ma_device_state", !7, i64 0}
!14 = !{!"_ZTS8ma_event", !12, i64 0, !7, i64 8, !7, i64 48}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTS9ma_result", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTS12ma_duplex_rb", !19, i64 0}
!19 = !{!"_ZTS9ma_pcm_rb", !20, i64 0, !22, i64 64, !12, i64 68}
!20 = !{!"_ZTS5ma_rb", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !7, i64 28, !7, i64 29, !21, i64 32}
!21 = !{!"_ZTS23ma_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTS9ma_format", !7, i64 0}
!23 = !{!"_ZTSN9ma_deviceUt_E", !24, i64 0, !6, i64 8, !6, i64 16, !25, i64 24}
!24 = !{!"_ZTS21ma_resample_algorithm", !7, i64 0}
!25 = !{!"_ZTSN9ma_deviceUt_Ut_E", !12, i64 0}
!26 = !{!"_ZTSN9ma_deviceUt0_E", !6, i64 0, !7, i64 8, !7, i64 264, !27, i64 520, !22, i64 524, !12, i64 528, !7, i64 532, !22, i64 788, !12, i64 792, !12, i64 796, !7, i64 800, !12, i64 1056, !12, i64 1060, !28, i64 1064, !29, i64 1072, !6, i64 1384, !12, i64 1392, !12, i64 1396, !6, i64 1400, !35, i64 1408, !35, i64 1416, !35, i64 1424}
!27 = !{!"_ZTS13ma_share_mode", !7, i64 0}
!28 = !{!"_ZTS19ma_channel_mix_mode", !7, i64 0}
!29 = !{!"_ZTS17ma_data_converter", !22, i64 0, !22, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !30, i64 24, !31, i64 28, !32, i64 32, !34, i64 104, !7, i64 296, !7, i64 297, !7, i64 298, !7, i64 299, !7, i64 300, !7, i64 301, !6, i64 304}
!30 = !{!"_ZTS14ma_dither_mode", !7, i64 0}
!31 = !{!"_ZTS32ma_data_converter_execution_path", !7, i64 0}
!32 = !{!"_ZTS20ma_channel_converter", !22, i64 0, !12, i64 4, !12, i64 8, !28, i64 12, !33, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !7, i64 48, !6, i64 56, !12, i64 64}
!33 = !{!"_ZTS26ma_channel_conversion_path", !7, i64 0}
!34 = !{!"_ZTS12ma_resampler", !6, i64 0, !6, i64 8, !6, i64 16, !22, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !7, i64 40, !6, i64 176, !12, i64 184}
!35 = !{!"long long", !7, i64 0}
!36 = !{!"_ZTSN9ma_deviceUt1_E", !6, i64 0, !7, i64 8, !7, i64 264, !27, i64 520, !22, i64 524, !12, i64 528, !7, i64 532, !22, i64 788, !12, i64 792, !12, i64 796, !7, i64 800, !12, i64 1056, !12, i64 1060, !28, i64 1064, !29, i64 1072, !6, i64 1384, !12, i64 1392, !12, i64 1396}
!37 = !{!38, !6, i64 40}
!38 = !{!"_ZTS10ma_context", !39, i64 0, !40, i64 104, !6, i64 112, !41, i64 120, !42, i64 264, !15, i64 272, !6, i64 280, !21, i64 288, !7, i64 320, !7, i64 360, !12, i64 400, !12, i64 404, !12, i64 408, !6, i64 416, !7, i64 424, !7, i64 1008}
!39 = !{!"_ZTS20ma_backend_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!40 = !{!"_ZTS10ma_backend", !7, i64 0}
!41 = !{!"_ZTS6ma_log", !7, i64 0, !12, i64 64, !21, i64 72, !7, i64 104}
!42 = !{!"_ZTS18ma_thread_priority", !7, i64 0}
!43 = !{!10, !11, i64 8}
!44 = !{!10, !6, i64 1912}
!45 = !{!10, !6, i64 3328}
!46 = !{!10, !6, i64 1896}
!47 = !{!10, !7, i64 396}
!48 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, 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"

%struct.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @ma_free(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress 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

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_event_signal(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14ma_thread_waitPm(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_context_uninit(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @ma_device_uninit(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca %struct.ma_allocation_callbacks, align 8
  %3 = tail call noundef i32 @_ZL25ma_device__is_initializedP9ma_device(ptr noundef %0)
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %75, label %4

4:                                                ; preds = %1
  %5 = tail call i32 @ma_device_is_started(ptr noundef %0)
  %.not45 = icmp eq i32 %5, 0
  br i1 %.not45, label %8, label %6

6:                                                ; preds = %4
  %7 = tail call i32 @ma_device_stop(ptr noundef %0)
  br label %8

8:                                                ; preds = %6, %4
  tail call void @_ZL20ma_device__set_stateP9ma_device15ma_device_state(ptr noundef %0, i32 noundef 0)
  %9 = load ptr, ptr %0, align 8, !tbaa !5
  %10 = tail call noundef i32 @_ZL34ma_context_is_backend_asynchronousP10ma_context(ptr noundef %9)
  %.not46 = icmp eq i32 %10, 0
  br i1 %.not46, label %11, label %15

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 96
  %13 = tail call i32 @ma_event_signal(ptr noundef nonnull %12)
  %14 = getelementptr inbounds i8, ptr %0, i64 384
  tail call void @_ZL14ma_thread_waitPm(ptr noundef nonnull %14)
  br label %15

15:                                               ; preds = %11, %8
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 40
  %18 = load ptr, ptr %17, align 8, !tbaa !36
  %.not47 = icmp eq ptr %18, null
  br i1 %.not47, label %21, label %19

19:                                               ; preds = %15
  %20 = tail call noundef i32 %18(ptr noundef nonnull %0)
  br label %21

21:                                               ; preds = %19, %15
  %22 = getelementptr inbounds i8, ptr %0, i64 288
  tail call void @ma_event_uninit(ptr noundef nonnull %22)
  %23 = getelementptr inbounds i8, ptr %0, i64 192
  tail call void @ma_event_uninit(ptr noundef nonnull %23)
  %24 = getelementptr inbounds i8, ptr %0, i64 96
  tail call void @ma_event_uninit(ptr noundef nonnull %24)
  %25 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @ma_mutex_uninit(ptr noundef nonnull %25)
  %26 = load ptr, ptr %0, align 8, !tbaa !5
  %27 = tail call noundef i32 @_ZL34ma_context_is_backend_asynchronousP10ma_context(ptr noundef %26)
  %.not48 = icmp eq i32 %27, 0
  br i1 %.not48, label %35, label %28

28:                                               ; preds = %21
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = load i32, ptr %29, align 8, !tbaa !42
  %31 = icmp eq i32 %30, 3
  br i1 %31, label %32, label %35

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %0, i64 408
  %34 = tail call i32 @ma_duplex_rb_uninit(ptr noundef nonnull %33)
  br label %35

35:                                               ; preds = %28, %32, %21
  %36 = getelementptr inbounds i8, ptr %0, i64 8
  %37 = load i32, ptr %36, align 8, !tbaa !42
  %.off = add i32 %37, -2
  %switch = icmp ult i32 %.off, 3
  br i1 %switch, label %38, label %42

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %0, i64 3016
  %40 = load ptr, ptr %0, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 288
  tail call void @ma_data_converter_uninit(ptr noundef nonnull %39, ptr noundef nonnull %41)
  %.pr = load i32, ptr %36, align 8, !tbaa !42
  br label %42

42:                                               ; preds = %35, %38
  %43 = phi i32 [ %37, %35 ], [ %.pr, %38 ]
  switch i32 %43, label %48 [
    i32 1, label %44
    i32 3, label %44
  ]

44:                                               ; preds = %42, %42
  %45 = getelementptr inbounds i8, ptr %0, i64 1584
  %46 = load ptr, ptr %0, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 288
  tail call void @ma_data_converter_uninit(ptr noundef nonnull %45, ptr noundef nonnull %47)
  br label %48

48:                                               ; preds = %42, %44
  %49 = getelementptr inbounds i8, ptr %0, i64 1912
  %50 = load ptr, ptr %49, align 8, !tbaa !43
  %.not49 = icmp eq ptr %50, null
  br i1 %.not49, label %54, label %51

51:                                               ; preds = %48
  %52 = load ptr, ptr %0, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 288
  tail call void @ma_free(ptr noundef nonnull %50, ptr noundef nonnull %53)
  br label %54

54:                                               ; preds = %51, %48
  %55 = getelementptr inbounds i8, ptr %0, i64 3328
  %56 = load ptr, ptr %55, align 8, !tbaa !44
  %.not50 = icmp eq ptr %56, null
  br i1 %.not50, label %60, label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr %0, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 288
  tail call void @ma_free(ptr noundef nonnull %56, ptr noundef nonnull %59)
  br label %60

60:                                               ; preds = %57, %54
  %61 = getelementptr inbounds i8, ptr %0, i64 1896
  %62 = load ptr, ptr %61, align 8, !tbaa !45
  %.not51 = icmp eq ptr %62, null
  br i1 %.not51, label %66, label %63

63:                                               ; preds = %60
  %64 = load ptr, ptr %0, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 288
  tail call void @ma_free(ptr noundef nonnull %62, ptr noundef nonnull %65)
  br label %66

66:                                               ; preds = %63, %60
  %67 = getelementptr inbounds i8, ptr %0, i64 396
  %68 = load i8, ptr %67, align 4, !tbaa !46
  %.not52 = icmp eq i8 %68, 0
  br i1 %.not52, label %74, label %69

69:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  %70 = load ptr, ptr %0, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %70, i64 288
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %71, i64 32, i1 false), !tbaa.struct !47
  %72 = tail call i32 @ma_context_uninit(ptr noundef %70)
  %73 = load ptr, ptr %0, align 8, !tbaa !5
  call void @ma_free(ptr noundef %73, ptr noundef nonnull %2)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  br label %74

74:                                               ; preds = %69, %66
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(3696) %0, i8 0, i64 3696, i1 false)
  br label %75

75:                                               ; preds = %1, %74
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL34ma_context_is_backend_asynchronousP10ma_context(ptr noundef) local_unnamed_addr #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @_ZL20ma_device__set_stateP9ma_device15ma_device_state(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL25ma_device__is_initializedP9ma_device(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_device_is_started(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_device_stop(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_duplex_rb_uninit(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @ma_data_converter_uninit(ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { alwaysinline 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 = { 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, !7, i64 0}
!6 = !{!"_ZTS9ma_device", !7, i64 0, !10, i64 8, !11, i64 12, !12, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !8, i64 56, !13, i64 96, !13, i64 192, !13, i64 288, !14, i64 384, !15, i64 392, !8, i64 396, !8, i64 397, !8, i64 398, !8, i64 399, !8, i64 400, !16, i64 404, !17, i64 408, !22, i64 480, !25, i64 512, !35, i64 1944, !8, i64 3344}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS14ma_device_type", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTS15ma_device_state", !8, i64 0}
!13 = !{!"_ZTS8ma_event", !11, i64 0, !8, i64 8, !8, i64 48}
!14 = !{!"long", !8, i64 0}
!15 = !{!"_ZTS9ma_result", !8, i64 0}
!16 = !{!"float", !8, i64 0}
!17 = !{!"_ZTS12ma_duplex_rb", !18, i64 0}
!18 = !{!"_ZTS9ma_pcm_rb", !19, i64 0, !21, i64 64, !11, i64 68}
!19 = !{!"_ZTS5ma_rb", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !8, i64 28, !8, i64 29, !20, i64 32}
!20 = !{!"_ZTS23ma_allocation_callbacks", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!21 = !{!"_ZTS9ma_format", !8, i64 0}
!22 = !{!"_ZTSN9ma_deviceUt_E", !23, i64 0, !7, i64 8, !7, i64 16, !24, i64 24}
!23 = !{!"_ZTS21ma_resample_algorithm", !8, i64 0}
!24 = !{!"_ZTSN9ma_deviceUt_Ut_E", !11, i64 0}
!25 = !{!"_ZTSN9ma_deviceUt0_E", !7, i64 0, !8, i64 8, !8, i64 264, !26, i64 520, !21, i64 524, !11, i64 528, !8, i64 532, !21, i64 788, !11, i64 792, !11, i64 796, !8, i64 800, !11, i64 1056, !11, i64 1060, !27, i64 1064, !28, i64 1072, !7, i64 1384, !11, i64 1392, !11, i64 1396, !7, i64 1400, !34, i64 1408, !34, i64 1416, !34, i64 1424}
!26 = !{!"_ZTS13ma_share_mode", !8, i64 0}
!27 = !{!"_ZTS19ma_channel_mix_mode", !8, i64 0}
!28 = !{!"_ZTS17ma_data_converter", !21, i64 0, !21, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !29, i64 24, !30, i64 28, !31, i64 32, !33, i64 104, !8, i64 296, !8, i64 297, !8, i64 298, !8, i64 299, !8, i64 300, !8, i64 301, !7, i64 304}
!29 = !{!"_ZTS14ma_dither_mode", !8, i64 0}
!30 = !{!"_ZTS32ma_data_converter_execution_path", !8, i64 0}
!31 = !{!"_ZTS20ma_channel_converter", !21, i64 0, !11, i64 4, !11, i64 8, !27, i64 12, !32, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !8, i64 48, !7, i64 56, !11, i64 64}
!32 = !{!"_ZTS26ma_channel_conversion_path", !8, i64 0}
!33 = !{!"_ZTS12ma_resampler", !7, i64 0, !7, i64 8, !7, i64 16, !21, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !7, i64 176, !11, i64 184}
!34 = !{!"long long", !8, i64 0}
!35 = !{!"_ZTSN9ma_deviceUt1_E", !7, i64 0, !8, i64 8, !8, i64 264, !26, i64 520, !21, i64 524, !11, i64 528, !8, i64 532, !21, i64 788, !11, i64 792, !11, i64 796, !8, i64 800, !11, i64 1056, !11, i64 1060, !27, i64 1064, !28, i64 1072, !7, i64 1384, !11, i64 1392, !11, i64 1396}
!36 = !{!37, !7, i64 40}
!37 = !{!"_ZTS10ma_context", !38, i64 0, !39, i64 104, !7, i64 112, !40, i64 120, !41, i64 264, !14, i64 272, !7, i64 280, !20, i64 288, !8, i64 320, !8, i64 360, !11, i64 400, !11, i64 404, !11, i64 408, !7, i64 416, !8, i64 424, !8, i64 1008}
!38 = !{!"_ZTS20ma_backend_callbacks", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96}
!39 = !{!"_ZTS10ma_backend", !8, i64 0}
!40 = !{!"_ZTS6ma_log", !8, i64 0, !11, i64 64, !20, i64 72, !8, i64 104}
!41 = !{!"_ZTS18ma_thread_priority", !8, i64 0}
!42 = !{!6, !10, i64 8}
!43 = !{!6, !7, i64 1912}
!44 = !{!6, !7, i64 3328}
!45 = !{!6, !7, i64 1896}
!46 = !{!6, !8, i64 396}
!47 = !{i64 0, i64 8, !48, i64 8, i64 8, !48, i64 16, i64 8, !48, i64 24, i64 8, !48}
!48 = !{!7, !7, i64 0}


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