; 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_data_source_vtable = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.ma_job = type { %union.anon.0, i64, i32, %union.anon.2 }
%union.anon.0 = type { i64 }
%union.anon.2 = type { %union.anon.4 }
%union.anon.4 = type { %struct.anon.8 }
%struct.anon.8 = type { ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i32 }
%struct.ma_data_source_config = type { ptr }
%struct.ma_resource_manager_inline_notification = type { %union.anon.76, ptr }
%union.anon.76 = type { %struct.ma_async_notification_event }
%struct.ma_async_notification_event = type { %struct.ma_async_notification_callbacks, %struct.ma_event }
%struct.ma_async_notification_callbacks = type { ptr }
%struct.ma_event = type { i32, %union.pthread_mutex_t, %union.pthread_cond_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 }
%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_resource_manager_pipeline_notifications = type { %struct.ma_resource_manager_pipeline_stage_notification, %struct.ma_resource_manager_pipeline_stage_notification }
%struct.ma_resource_manager_pipeline_stage_notification = type { ptr, ptr }
%struct.ma_resource_manager_data_source_config = type { ptr, ptr, ptr, i64, i64, i64, i64, i64, i32, i32 }
%struct.ma_resource_manager_data_stream = type { %struct.ma_data_source_base, ptr, i32, %struct.ma_decoder, i32, i64, i32, i64, i32, i32, i32, i32, ptr, [2 x i32], i32, i32, [2 x i32], i32 }
%struct.ma_data_source_base = type { ptr, i64, i64, i64, i64, ptr, ptr, ptr, i32 }
%struct.ma_decoder = type { %struct.ma_data_source_base, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, i32, i32, %struct.ma_data_converter, ptr, i64, i64, i64, %struct.ma_allocation_callbacks, %union.anon.61 }
%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.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%union.anon.61 = type { %struct.anon.63 }
%struct.anon.63 = type { ptr, i64, i64 }
%struct.ma_resource_manager = type { %struct.ma_resource_manager_config, ptr, %union.pthread_mutex_t, [64 x i64], %struct.ma_job_queue, %struct.ma_default_vfs, %struct.ma_log }
%struct.ma_resource_manager_config = type { %struct.ma_allocation_callbacks, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, ptr }
%struct.ma_job_queue = type { i32, i32, i64, i64, %struct.ma_semaphore, %struct.ma_slot_allocator, ptr, i32, ptr, i32 }
%struct.ma_semaphore = type { i32, %union.pthread_mutex_t, %union.pthread_cond_t }
%struct.ma_slot_allocator = type { ptr, ptr, i32, i32, i32, ptr }
%struct.ma_default_vfs = type { %struct.ma_vfs_callbacks, %struct.ma_allocation_callbacks }
%struct.ma_vfs_callbacks = type { 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 }
%struct.anon.10 = type { ptr, ptr, ptr, i64, ptr, ptr }

@_ZL40g_ma_resource_manager_data_stream_vtable = external hidden global %struct.ma_data_source_vtable, align 8

; 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: mustprogress uwtable
declare dso_local noundef ptr @_Z14ma_copy_stringPKcPK23ma_allocation_callbacks(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z16ma_copy_string_wPKwPK23ma_allocation_callbacks(ptr noundef, ptr noundef) #1

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

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

; 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 i32 @ma_async_notification_signal(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @ma_job_init(ptr dead_on_unwind noalias writable sret(%struct.ma_job) align 8, i16 noundef zeroext) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ma_data_source_config_init() #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i32 @ma_data_source_init(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_data_source_set_looping(ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_data_source_set_range_in_pcm_frames(ptr noundef, i64 noundef, i64 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i32 @ma_data_source_set_loop_point_in_pcm_frames(ptr noundef, i64 noundef, i64 noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL44ma_resource_manager_inline_notification_initP19ma_resource_managerP39ma_resource_manager_inline_notification(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_resource_manager_post_job(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL46ma_resource_manager_inline_notification_uninitP39ma_resource_manager_inline_notification(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL55ma_resource_manager_inline_notification_wait_and_uninitP39ma_resource_manager_inline_notification(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_resource_manager_data_stream_init_ex(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.ma_data_source_config, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.ma_job, align 8
  %13 = alloca i32, align 4
  %14 = alloca %struct.ma_resource_manager_inline_notification, align 8
  %15 = alloca %struct.ma_resource_manager_pipeline_notifications, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.ma_data_source_config, align 8
  %18 = alloca %struct.ma_job, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 104, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 112, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %34

21:                                               ; preds = %3
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %33

24:                                               ; preds = %21
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %25, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %33

29:                                               ; preds = %24
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %30, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef %32)
  br label %33

33:                                               ; preds = %29, %24, %21
  store i32 -2, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %219

34:                                               ; preds = %3
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %35, i8 0, i64 728, i1 false)
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  store i32 -2, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %219

39:                                               ; preds = %34
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %48

44:                                               ; preds = %39
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %47, i64 32, i1 false), !tbaa.struct !14
  br label %49

48:                                               ; preds = %39
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 32, i1 false)
  br label %49

49:                                               ; preds = %48, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %50 = call ptr @ma_data_source_config_init()
  %51 = getelementptr inbounds %struct.ma_data_source_config, ptr %17, i32 0, i32 0
  store ptr %50, ptr %51, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %17, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %52 = getelementptr inbounds %struct.ma_data_source_config, ptr %9, i32 0, i32 0
  store ptr @_ZL40g_ma_resource_manager_data_stream_vtable, ptr %52, align 8, !tbaa !16
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ma_resource_manager_data_stream, ptr %53, i32 0, i32 0
  %55 = call i32 @ma_data_source_init(ptr noundef %9, ptr noundef %54)
  store i32 %55, ptr %8, align 4, !tbaa !18
  %56 = load i32, ptr %8, align 4, !tbaa !18
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %60

58:                                               ; preds = %49
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef %15)
  %59 = load i32, ptr %8, align 4, !tbaa !18
  store i32 %59, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %219

60:                                               ; preds = %49
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ma_resource_manager_data_stream, ptr %62, i32 0, i32 1
  store ptr %61, ptr %63, align 8, !tbaa !20
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %64, i32 0, i32 9
  %66 = load i32, ptr %65, align 4, !tbaa !33
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ma_resource_manager_data_stream, ptr %67, i32 0, i32 2
  store i32 %66, ptr %68, align 8, !tbaa !34
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ma_resource_manager_data_stream, ptr %69, i32 0, i32 14
  store i32 -19, ptr %70, align 8, !tbaa !35
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %72, i32 0, i32 4
  %74 = load i64, ptr %73, align 8, !tbaa !36
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %75, i32 0, i32 5
  %77 = load i64, ptr %76, align 8, !tbaa !37
  %78 = call i32 @ma_data_source_set_range_in_pcm_frames(ptr noundef %71, i64 noundef %74, i64 noundef %77)
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %80, i32 0, i32 6
  %82 = load i64, ptr %81, align 8, !tbaa !38
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %83, i32 0, i32 7
  %85 = load i64, ptr %84, align 8, !tbaa !39
  %86 = call i32 @ma_data_source_set_loop_point_in_pcm_frames(ptr noundef %79, i64 noundef %82, i64 noundef %85)
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %88, i32 0, i32 8
  %90 = load i32, ptr %89, align 8, !tbaa !40
  %91 = call i32 @ma_data_source_set_looping(ptr noundef %87, i32 noundef %90)
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = icmp eq ptr %92, null
  br i1 %93, label %104, label %94

94:                                               ; preds = %60
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !41
  %98 = icmp eq ptr %97, null
  br i1 %98, label %99, label %105

99:                                               ; preds = %94
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !42
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %105

104:                                              ; preds = %99, %60
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef %15)
  store i32 -2, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %219

105:                                              ; preds = %99, %94
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !41
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %118

110:                                              ; preds = %105
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !41
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ma_resource_manager, ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds %struct.ma_resource_manager_config, ptr %115, i32 0, i32 0
  %117 = call noundef ptr @_Z14ma_copy_stringPKcPK23ma_allocation_callbacks(ptr noundef %113, ptr noundef %116)
  store ptr %117, ptr %10, align 8, !tbaa !5
  br label %126

118:                                              ; preds = %105
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %119, i32 0, i32 1
  %121 = load ptr, ptr %120, align 8, !tbaa !42
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ma_resource_manager, ptr %122, i32 0, i32 0
  %124 = getelementptr inbounds %struct.ma_resource_manager_config, ptr %123, i32 0, i32 0
  %125 = call noundef ptr @_Z16ma_copy_string_wPKwPK23ma_allocation_callbacks(ptr noundef %121, ptr noundef %124)
  store ptr %125, ptr %11, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %118, %110
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = icmp eq ptr %127, null
  br i1 %128, label %129, label %133

129:                                              ; preds = %126
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = icmp eq ptr %130, null
  br i1 %131, label %132, label %133

132:                                              ; preds = %129
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef %15)
  store i32 -4, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %219

133:                                              ; preds = %129, %126
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %134, i32 0, i32 9
  %136 = load i32, ptr %135, align 4, !tbaa !33
  %137 = and i32 %136, 4
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %145, label %139

139:                                              ; preds = %133
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %140, i32 0, i32 9
  %142 = load i32, ptr %141, align 4, !tbaa !33
  %143 = and i32 %142, 8
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %148

145:                                              ; preds = %139, %133
  store i32 1, ptr %13, align 4, !tbaa !9
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = call noundef i32 @_ZL44ma_resource_manager_inline_notification_initP19ma_resource_managerP39ma_resource_manager_inline_notification(ptr noundef %146, ptr noundef %14)
  br label %148

148:                                              ; preds = %145, %139
  call void @_ZL61ma_resource_manager_pipeline_notifications_acquire_all_fencesPK42ma_resource_manager_pipeline_notifications(ptr noundef %15)
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %150, i32 0, i32 3
  %152 = load i64, ptr %151, align 8, !tbaa !43
  call void @_ZL51ma_resource_manager_data_stream_set_absolute_cursorP31ma_resource_manager_data_streamy(ptr noundef %149, i64 noundef %152)
  call void @llvm.lifetime.start.p0(i64 104, ptr %18) #5
  call void @ma_job_init(ptr dead_on_unwind writable sret(%struct.ma_job) align 8 %18, i16 noundef zeroext 7)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %18, i64 104, i1 false), !tbaa.struct !44
  call void @llvm.lifetime.end.p0(i64 104, ptr %18) #5
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = call noundef i32 @_ZL52ma_resource_manager_data_stream_next_execution_orderP31ma_resource_manager_data_stream(ptr noundef %153)
  %155 = getelementptr inbounds %struct.ma_job, ptr %12, i32 0, i32 2
  store i32 %154, ptr %155, align 8, !tbaa !47
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.ma_job, ptr %12, i32 0, i32 3
  %158 = getelementptr inbounds %struct.anon.10, ptr %157, i32 0, i32 0
  store ptr %156, ptr %158, align 8, !tbaa !45
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.ma_job, ptr %12, i32 0, i32 3
  %161 = getelementptr inbounds %struct.anon.10, ptr %160, i32 0, i32 1
  store ptr %159, ptr %161, align 8, !tbaa !45
  %162 = load ptr, ptr %11, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.ma_job, ptr %12, i32 0, i32 3
  %164 = getelementptr inbounds %struct.anon.10, ptr %163, i32 0, i32 2
  store ptr %162, ptr %164, align 8, !tbaa !45
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %165, i32 0, i32 3
  %167 = load i64, ptr %166, align 8, !tbaa !43
  %168 = getelementptr inbounds %struct.ma_job, ptr %12, i32 0, i32 3
  %169 = getelementptr inbounds %struct.anon.10, ptr %168, i32 0, i32 3
  store i64 %167, ptr %169, align 8, !tbaa !45
  %170 = load i32, ptr %13, align 4, !tbaa !9
  %171 = icmp eq i32 %170, 1
  br i1 %171, label %172, label %173

172:                                              ; preds = %148
  br label %177

173:                                              ; preds = %148
  %174 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %15, i32 0, i32 0
  %175 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %174, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8, !tbaa !49
  br label %177

177:                                              ; preds = %173, %172
  %178 = phi ptr [ %14, %172 ], [ %176, %173 ]
  %179 = getelementptr inbounds %struct.ma_job, ptr %12, i32 0, i32 3
  %180 = getelementptr inbounds %struct.anon.10, ptr %179, i32 0, i32 4
  store ptr %178, ptr %180, align 8, !tbaa !45
  %181 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %15, i32 0, i32 0
  %182 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %181, i32 0, i32 1
  %183 = load ptr, ptr %182, align 8, !tbaa !52
  %184 = getelementptr inbounds %struct.ma_job, ptr %12, i32 0, i32 3
  %185 = getelementptr inbounds %struct.anon.10, ptr %184, i32 0, i32 5
  store ptr %183, ptr %185, align 8, !tbaa !45
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = call i32 @ma_resource_manager_post_job(ptr noundef %186, ptr noundef %12)
  store i32 %187, ptr %8, align 4, !tbaa !18
  %188 = load i32, ptr %8, align 4, !tbaa !18
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %204

190:                                              ; preds = %177
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef %15)
  call void @_ZL61ma_resource_manager_pipeline_notifications_release_all_fencesPK42ma_resource_manager_pipeline_notifications(ptr noundef %15)
  %191 = load i32, ptr %13, align 4, !tbaa !9
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %194

193:                                              ; preds = %190
  call void @_ZL46ma_resource_manager_inline_notification_uninitP39ma_resource_manager_inline_notification(ptr noundef %14)
  br label %194

194:                                              ; preds = %193, %190
  %195 = load ptr, ptr %10, align 8, !tbaa !5
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.ma_resource_manager, ptr %196, i32 0, i32 0
  %198 = getelementptr inbounds %struct.ma_resource_manager_config, ptr %197, i32 0, i32 0
  call void @ma_free(ptr noundef %195, ptr noundef %198)
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.ma_resource_manager, ptr %200, i32 0, i32 0
  %202 = getelementptr inbounds %struct.ma_resource_manager_config, ptr %201, i32 0, i32 0
  call void @ma_free(ptr noundef %199, ptr noundef %202)
  %203 = load i32, ptr %8, align 4, !tbaa !18
  store i32 %203, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %219

204:                                              ; preds = %177
  %205 = load i32, ptr %13, align 4, !tbaa !9
  %206 = icmp ne i32 %205, 0
  br i1 %206, label %207, label %218

207:                                              ; preds = %204
  call void @_ZL55ma_resource_manager_inline_notification_wait_and_uninitP39ma_resource_manager_inline_notification(ptr noundef %14)
  %208 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %15, i32 0, i32 0
  %209 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %208, i32 0, i32 0
  %210 = load ptr, ptr %209, align 8, !tbaa !49
  %211 = icmp ne ptr %210, null
  br i1 %211, label %212, label %217

212:                                              ; preds = %207
  %213 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %15, i32 0, i32 0
  %214 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %213, i32 0, i32 0
  %215 = load ptr, ptr %214, align 8, !tbaa !49
  %216 = call i32 @ma_async_notification_signal(ptr noundef %215)
  br label %217

217:                                              ; preds = %212, %207
  br label %218

218:                                              ; preds = %217, %204
  store i32 0, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %219

219:                                              ; preds = %218, %194, %132, %104, %58, %38, %33
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %220 = load i32, ptr %4, align 4
  ret i32 %220
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL51ma_resource_manager_data_stream_set_absolute_cursorP31ma_resource_manager_data_streamy(ptr noundef, i64 noundef) #4

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL61ma_resource_manager_pipeline_notifications_release_all_fencesPK42ma_resource_manager_pipeline_notifications(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"_ZTS38ma_resource_manager_data_source_config", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !10, i64 64, !10, i64 68}
!13 = !{!"long long", !7, i64 0}
!14 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5}
!15 = !{i64 0, i64 8, !5}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS21ma_data_source_config", !6, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTS9ma_result", !7, i64 0}
!20 = !{!21, !6, i64 72}
!21 = !{!"_ZTS31ma_resource_manager_data_stream", !22, i64 0, !6, i64 72, !10, i64 80, !23, i64 88, !10, i64 640, !13, i64 648, !10, i64 656, !13, i64 664, !10, i64 672, !10, i64 676, !10, i64 680, !10, i64 684, !6, i64 688, !7, i64 696, !19, i64 704, !10, i64 708, !7, i64 712, !10, i64 720}
!22 = !{!"_ZTS19ma_data_source_base", !6, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64}
!23 = !{!"_ZTS10ma_decoder", !22, i64 0, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !24, i64 136, !10, i64 140, !10, i64 144, !25, i64 152, !6, i64 464, !13, i64 472, !13, i64 480, !13, i64 488, !32, i64 496, !7, i64 528}
!24 = !{!"_ZTS9ma_format", !7, i64 0}
!25 = !{!"_ZTS17ma_data_converter", !24, i64 0, !24, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !26, i64 24, !27, i64 28, !28, i64 32, !31, i64 104, !7, i64 296, !7, i64 297, !7, i64 298, !7, i64 299, !7, i64 300, !7, i64 301, !6, i64 304}
!26 = !{!"_ZTS14ma_dither_mode", !7, i64 0}
!27 = !{!"_ZTS32ma_data_converter_execution_path", !7, i64 0}
!28 = !{!"_ZTS20ma_channel_converter", !24, i64 0, !10, i64 4, !10, i64 8, !29, i64 12, !30, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !7, i64 48, !6, i64 56, !10, i64 64}
!29 = !{!"_ZTS19ma_channel_mix_mode", !7, i64 0}
!30 = !{!"_ZTS26ma_channel_conversion_path", !7, i64 0}
!31 = !{!"_ZTS12ma_resampler", !6, i64 0, !6, i64 8, !6, i64 16, !24, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !7, i64 40, !6, i64 176, !10, i64 184}
!32 = !{!"_ZTS23ma_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!33 = !{!12, !10, i64 68}
!34 = !{!21, !10, i64 80}
!35 = !{!21, !19, i64 704}
!36 = !{!12, !13, i64 32}
!37 = !{!12, !13, i64 40}
!38 = !{!12, !13, i64 48}
!39 = !{!12, !13, i64 56}
!40 = !{!12, !10, i64 64}
!41 = !{!12, !6, i64 0}
!42 = !{!12, !6, i64 8}
!43 = !{!12, !13, i64 24}
!44 = !{i64 0, i64 8, !45, i64 8, i64 8, !46, i64 16, i64 4, !9, i64 24, i64 80, !45}
!45 = !{!7, !7, i64 0}
!46 = !{!13, !13, i64 0}
!47 = !{!48, !10, i64 16}
!48 = !{!"_ZTS6ma_job", !7, i64 0, !13, i64 8, !10, i64 16, !7, i64 24}
!49 = !{!50, !6, i64 0}
!50 = !{!"_ZTS42ma_resource_manager_pipeline_notifications", !51, i64 0, !51, i64 16}
!51 = !{!"_ZTS47ma_resource_manager_pipeline_stage_notification", !6, i64 0, !6, i64 8}
!52 = !{!50, !6, i64 8}


; 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_data_source_vtable = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.ma_job = type { %union.anon.0, i64, i32, %union.anon.2 }
%union.anon.0 = type { i64 }
%union.anon.2 = type { %union.anon.4 }
%union.anon.4 = type { %struct.anon.8 }
%struct.anon.8 = type { ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i32 }
%struct.ma_data_source_config = type { ptr }
%struct.ma_resource_manager_inline_notification = type { %union.anon.76, ptr }
%union.anon.76 = type { %struct.ma_async_notification_event }
%struct.ma_async_notification_event = type { %struct.ma_async_notification_callbacks, %struct.ma_event }
%struct.ma_async_notification_callbacks = type { ptr }
%struct.ma_event = type { i32, %union.pthread_mutex_t, %union.pthread_cond_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 }
%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_resource_manager_pipeline_notifications = type { %struct.ma_resource_manager_pipeline_stage_notification, %struct.ma_resource_manager_pipeline_stage_notification }
%struct.ma_resource_manager_pipeline_stage_notification = type { ptr, ptr }

@_ZL40g_ma_resource_manager_data_stream_vtable = external hidden global %struct.ma_data_source_vtable, align 8

; 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 uwtable
declare dso_local noundef ptr @_Z14ma_copy_stringPKcPK23ma_allocation_callbacks(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z16ma_copy_string_wPKwPK23ma_allocation_callbacks(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

; 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 i32 @ma_async_notification_signal(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @ma_job_init(ptr dead_on_unwind noalias writable sret(%struct.ma_job) align 8, i16 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ma_data_source_config_init() local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i32 @ma_data_source_init(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_data_source_set_looping(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_data_source_set_range_in_pcm_frames(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i32 @ma_data_source_set_loop_point_in_pcm_frames(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL44ma_resource_manager_inline_notification_initP19ma_resource_managerP39ma_resource_manager_inline_notification(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_resource_manager_post_job(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_resource_manager_data_stream_init_ex(ptr noundef %0, ptr noundef readonly %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca %struct.ma_data_source_config, align 8
  %5 = alloca %struct.ma_job, align 8
  %6 = alloca %struct.ma_resource_manager_inline_notification, align 8
  %7 = alloca %struct.ma_resource_manager_pipeline_notifications, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  %8 = icmp eq ptr %2, null
  br i1 %8, label %9, label %14

9:                                                ; preds = %3
  %.not74 = icmp eq ptr %1, null
  br i1 %.not74, label %90, label %10

10:                                               ; preds = %9
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %.not75 = icmp eq ptr %12, null
  br i1 %.not75, label %90, label %13

13:                                               ; preds = %10
  tail call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef nonnull %12)
  br label %90

14:                                               ; preds = %3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(728) %2, i8 0, i64 728, i1 false)
  %15 = icmp eq ptr %1, null
  br i1 %15, label %90, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %1, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %.not = icmp eq ptr %18, null
  br i1 %.not, label %20, label %19

19:                                               ; preds = %16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %18, i64 32, i1 false), !tbaa.struct !12
  br label %21

20:                                               ; preds = %16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %7, i8 0, i64 32, i1 false)
  br label %21

21:                                               ; preds = %20, %19
  %22 = tail call ptr @ma_data_source_config_init()
  store ptr @_ZL40g_ma_resource_manager_data_stream_vtable, ptr %4, align 8, !tbaa !14
  %23 = call i32 @ma_data_source_init(ptr noundef nonnull %4, ptr noundef nonnull %2)
  %.not67 = icmp eq i32 %23, 0
  br i1 %.not67, label %25, label %24

24:                                               ; preds = %21
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef nonnull %7)
  br label %90

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %2, i64 72
  store ptr %0, ptr %26, align 8, !tbaa !16
  %27 = getelementptr inbounds i8, ptr %1, i64 68
  %28 = load i32, ptr %27, align 4, !tbaa !30
  %29 = getelementptr inbounds i8, ptr %2, i64 80
  store i32 %28, ptr %29, align 8, !tbaa !31
  %30 = getelementptr inbounds i8, ptr %2, i64 704
  store i32 -19, ptr %30, align 8, !tbaa !32
  %31 = getelementptr inbounds i8, ptr %1, i64 32
  %32 = load i64, ptr %31, align 8, !tbaa !33
  %33 = getelementptr inbounds i8, ptr %1, i64 40
  %34 = load i64, ptr %33, align 8, !tbaa !34
  %35 = call i32 @ma_data_source_set_range_in_pcm_frames(ptr noundef nonnull %2, i64 noundef %32, i64 noundef %34)
  %36 = getelementptr inbounds i8, ptr %1, i64 48
  %37 = load i64, ptr %36, align 8, !tbaa !35
  %38 = getelementptr inbounds i8, ptr %1, i64 56
  %39 = load i64, ptr %38, align 8, !tbaa !36
  %40 = call i32 @ma_data_source_set_loop_point_in_pcm_frames(ptr noundef nonnull %2, i64 noundef %37, i64 noundef %39)
  %41 = getelementptr inbounds i8, ptr %1, i64 64
  %42 = load i32, ptr %41, align 8, !tbaa !37
  %43 = call i32 @ma_data_source_set_looping(ptr noundef nonnull %2, i32 noundef %42)
  %44 = icmp eq ptr %0, null
  br i1 %44, label %52, label %45

45:                                               ; preds = %25
  %46 = load ptr, ptr %1, align 8, !tbaa !38
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %1, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !39
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %55

52:                                               ; preds = %48, %25
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef nonnull %7)
  br label %90

53:                                               ; preds = %45
  %54 = call noundef ptr @_Z14ma_copy_stringPKcPK23ma_allocation_callbacks(ptr noundef nonnull %46, ptr noundef nonnull %0)
  br label %57

55:                                               ; preds = %48
  %56 = call noundef ptr @_Z16ma_copy_string_wPKwPK23ma_allocation_callbacks(ptr noundef nonnull %50, ptr noundef nonnull %0)
  br label %57

57:                                               ; preds = %55, %53
  %.057 = phi ptr [ %54, %53 ], [ null, %55 ]
  %.056 = phi ptr [ null, %53 ], [ %56, %55 ]
  %58 = icmp eq ptr %.057, null
  %59 = icmp eq ptr %.056, null
  %or.cond = and i1 %58, %59
  br i1 %or.cond, label %60, label %61

60:                                               ; preds = %57
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef nonnull %7)
  br label %90

61:                                               ; preds = %57
  %62 = load i32, ptr %27, align 4, !tbaa !30
  %63 = and i32 %62, 12
  %or.cond76.not = icmp eq i32 %63, 4
  br i1 %or.cond76.not, label %66, label %64

64:                                               ; preds = %61
  %65 = call noundef i32 @_ZL44ma_resource_manager_inline_notification_initP19ma_resource_managerP39ma_resource_manager_inline_notification(ptr noundef nonnull %0, ptr noundef nonnull %6)
  br label %66

66:                                               ; preds = %61, %64
  call void @_ZL61ma_resource_manager_pipeline_notifications_acquire_all_fencesPK42ma_resource_manager_pipeline_notifications(ptr noundef nonnull %7)
  %67 = getelementptr inbounds i8, ptr %1, i64 24
  %68 = load i64, ptr %67, align 8, !tbaa !40
  call void @_ZL51ma_resource_manager_data_stream_set_absolute_cursorP31ma_resource_manager_data_streamy(ptr noundef nonnull %2, i64 noundef %68)
  call void @ma_job_init(ptr dead_on_unwind nonnull writable sret(%struct.ma_job) align 8 %5, i16 noundef zeroext 7)
  %69 = call noundef i32 @_ZL52ma_resource_manager_data_stream_next_execution_orderP31ma_resource_manager_data_stream(ptr noundef nonnull %2)
  %70 = getelementptr inbounds i8, ptr %5, i64 16
  store i32 %69, ptr %70, align 8, !tbaa !41
  %71 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr %2, ptr %71, align 8, !tbaa !43
  %72 = getelementptr inbounds i8, ptr %5, i64 32
  store ptr %.057, ptr %72, align 8, !tbaa !43
  %73 = getelementptr inbounds i8, ptr %5, i64 40
  store ptr %.056, ptr %73, align 8, !tbaa !43
  %74 = load i64, ptr %67, align 8, !tbaa !40
  %75 = getelementptr inbounds i8, ptr %5, i64 48
  store i64 %74, ptr %75, align 8, !tbaa !43
  %76 = load ptr, ptr %7, align 8
  %spec.select = select i1 %or.cond76.not, ptr %76, ptr %6
  %77 = getelementptr inbounds i8, ptr %5, i64 56
  store ptr %spec.select, ptr %77, align 8, !tbaa !43
  %78 = getelementptr inbounds i8, ptr %7, i64 8
  %79 = load ptr, ptr %78, align 8, !tbaa !44
  %80 = getelementptr inbounds i8, ptr %5, i64 64
  store ptr %79, ptr %80, align 8, !tbaa !43
  %81 = call i32 @ma_resource_manager_post_job(ptr noundef nonnull %0, ptr noundef nonnull %5)
  %.not70 = icmp eq i32 %81, 0
  br i1 %.not70, label %85, label %82

82:                                               ; preds = %66
  call void @_ZL67ma_resource_manager_pipeline_notifications_signal_all_notificationsPK42ma_resource_manager_pipeline_notifications(ptr noundef nonnull %7)
  call void @_ZL61ma_resource_manager_pipeline_notifications_release_all_fencesPK42ma_resource_manager_pipeline_notifications(ptr noundef nonnull %7)
  br i1 %or.cond76.not, label %84, label %83

83:                                               ; preds = %82
  call void @_ZL46ma_resource_manager_inline_notification_uninitP39ma_resource_manager_inline_notification(ptr noundef nonnull %6)
  br label %84

84:                                               ; preds = %83, %82
  call void @ma_free(ptr noundef %.057, ptr noundef nonnull %0)
  call void @ma_free(ptr noundef %.056, ptr noundef nonnull %0)
  br label %90

85:                                               ; preds = %66
  br i1 %or.cond76.not, label %90, label %86

86:                                               ; preds = %85
  call void @_ZL55ma_resource_manager_inline_notification_wait_and_uninitP39ma_resource_manager_inline_notification(ptr noundef nonnull %6)
  %87 = load ptr, ptr %7, align 8, !tbaa !47
  %.not72 = icmp eq ptr %87, null
  br i1 %.not72, label %90, label %88

88:                                               ; preds = %86
  %89 = call i32 @ma_async_notification_signal(ptr noundef nonnull %87)
  br label %90

90:                                               ; preds = %85, %88, %86, %14, %9, %10, %13, %84, %60, %52, %24
  %.0 = phi i32 [ %23, %24 ], [ -2, %52 ], [ -4, %60 ], [ %81, %84 ], [ -2, %13 ], [ -2, %10 ], [ -2, %9 ], [ -2, %14 ], [ 0, %86 ], [ 0, %88 ], [ 0, %85 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret i32 %.0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL51ma_resource_manager_data_stream_set_absolute_cursorP31ma_resource_manager_data_streamy(ptr noundef, i64 noundef) local_unnamed_addr #4

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 16}
!6 = !{!"_ZTS38ma_resource_manager_data_source_config", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !11, i64 64, !11, i64 68}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{i64 0, i64 8, !13, i64 8, i64 8, !13, i64 16, i64 8, !13, i64 24, i64 8, !13}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"_ZTS21ma_data_source_config", !7, i64 0}
!16 = !{!17, !7, i64 72}
!17 = !{!"_ZTS31ma_resource_manager_data_stream", !18, i64 0, !7, i64 72, !11, i64 80, !19, i64 88, !11, i64 640, !10, i64 648, !11, i64 656, !10, i64 664, !11, i64 672, !11, i64 676, !11, i64 680, !11, i64 684, !7, i64 688, !8, i64 696, !29, i64 704, !11, i64 708, !8, i64 712, !11, i64 720}
!18 = !{!"_ZTS19ma_data_source_base", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !11, i64 64}
!19 = !{!"_ZTS10ma_decoder", !18, i64 0, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !10, i64 128, !20, i64 136, !11, i64 140, !11, i64 144, !21, i64 152, !7, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !28, i64 496, !8, i64 528}
!20 = !{!"_ZTS9ma_format", !8, i64 0}
!21 = !{!"_ZTS17ma_data_converter", !20, i64 0, !20, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !22, i64 24, !23, i64 28, !24, i64 32, !27, i64 104, !8, i64 296, !8, i64 297, !8, i64 298, !8, i64 299, !8, i64 300, !8, i64 301, !7, i64 304}
!22 = !{!"_ZTS14ma_dither_mode", !8, i64 0}
!23 = !{!"_ZTS32ma_data_converter_execution_path", !8, i64 0}
!24 = !{!"_ZTS20ma_channel_converter", !20, i64 0, !11, i64 4, !11, i64 8, !25, i64 12, !26, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !8, i64 48, !7, i64 56, !11, i64 64}
!25 = !{!"_ZTS19ma_channel_mix_mode", !8, i64 0}
!26 = !{!"_ZTS26ma_channel_conversion_path", !8, i64 0}
!27 = !{!"_ZTS12ma_resampler", !7, i64 0, !7, i64 8, !7, i64 16, !20, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !7, i64 176, !11, i64 184}
!28 = !{!"_ZTS23ma_allocation_callbacks", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!29 = !{!"_ZTS9ma_result", !8, i64 0}
!30 = !{!6, !11, i64 68}
!31 = !{!17, !11, i64 80}
!32 = !{!17, !29, i64 704}
!33 = !{!6, !10, i64 32}
!34 = !{!6, !10, i64 40}
!35 = !{!6, !10, i64 48}
!36 = !{!6, !10, i64 56}
!37 = !{!6, !11, i64 64}
!38 = !{!6, !7, i64 0}
!39 = !{!6, !7, i64 8}
!40 = !{!6, !10, i64 24}
!41 = !{!42, !11, i64 16}
!42 = !{!"_ZTS6ma_job", !8, i64 0, !10, i64 8, !11, i64 16, !8, i64 24}
!43 = !{!8, !8, i64 0}
!44 = !{!45, !7, i64 8}
!45 = !{!"_ZTS42ma_resource_manager_pipeline_notifications", !46, i64 0, !46, i64 16}
!46 = !{!"_ZTS47ma_resource_manager_pipeline_stage_notification", !7, i64 0, !7, i64 8}
!47 = !{!45, !7, i64 0}


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