; 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_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_sound_config = type { ptr, ptr, ptr, ptr, i32, i32, i32, i32, i64, i64, i64, i64, i64, i32, ptr }
%struct.ma_engine = type { %struct.ma_node_graph, ptr, ptr, ptr, i32, i32, [4 x %struct.ma_spatializer_listener], %struct.ma_allocation_callbacks, i8, i8, i32, ptr, i32, i32, i32 }
%struct.ma_node_graph = type { %struct.ma_node_base, %struct.ma_node_base, i16, i32 }
%struct.ma_node_base = type { ptr, ptr, ptr, i16, i16, i16, i16, i32, [2 x i64], i64, i32, i32, ptr, ptr, [2 x %struct.ma_node_input_bus], [2 x %struct.ma_node_output_bus], ptr, i32 }
%struct.ma_node_input_bus = type { %struct.ma_node_output_bus, i32, i32, i8 }
%struct.ma_node_output_bus = type { ptr, i8, i8, i8, i32, i32, i32, i32, float, ptr, ptr, ptr }
%struct.ma_spatializer_listener = type { %struct.ma_spatializer_listener_config, %struct.ma_vec3f, %struct.ma_vec3f, %struct.ma_vec3f, i32, i32, ptr }
%struct.ma_spatializer_listener_config = type { i32, ptr, i32, float, float, float, float, %struct.ma_vec3f }
%struct.ma_vec3f = type { float, float, float }
%struct.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.ma_sound = type { %struct.ma_engine_node, ptr, i64, i32, i8, ptr }
%struct.ma_engine_node = type { %struct.ma_node_base, ptr, i32, %struct.ma_fader, %struct.ma_linear_resampler, %struct.ma_spatializer, %struct.ma_panner, float, float, float, i32, i32, i32, i8, ptr }
%struct.ma_fader = type { %struct.ma_fader_config, float, float, i64, i64 }
%struct.ma_fader_config = type { i32, i32, i32 }
%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_spatializer = type { i32, i32, ptr, i32, i32, i32, float, float, float, float, float, float, float, float, float, float, i32, %struct.ma_vec3f, %struct.ma_vec3f, %struct.ma_vec3f, float, %struct.ma_gainer, ptr, ptr, i32 }
%struct.ma_gainer = type { %struct.ma_gainer_config, i32, ptr, ptr, ptr, i32 }
%struct.ma_gainer_config = type { i32, i32 }
%struct.ma_panner = type { i32, i32, i32, float }

; 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 ptr @ma_malloc(i64 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 nounwind uwtable
declare dso_local i32 @ma_fence_acquire(ptr noundef) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @ma_resource_manager_pipeline_notifications_init(ptr dead_on_unwind noalias writable sret(%struct.ma_resource_manager_pipeline_notifications) align 8) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @ma_resource_manager_data_source_config_init(ptr dead_on_unwind noalias writable sret(%struct.ma_resource_manager_data_source_config) align 8) #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z32ma_sound_init_from_file_internalP9ma_enginePK15ma_sound_configP8ma_sound(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 i32, align 4
  %10 = alloca %struct.ma_sound_config, align 8
  %11 = alloca %struct.ma_resource_manager_pipeline_notifications, align 8
  %12 = alloca i32, align 4
  %13 = alloca %struct.ma_resource_manager_pipeline_notifications, align 8
  %14 = alloca %struct.ma_resource_manager_data_source_config, 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
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 104, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.ma_sound_config, ptr %15, i32 0, i32 7
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = or i32 %17, 8
  store i32 %18, ptr %9, align 4, !tbaa !15
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ma_engine, ptr %19, i32 0, i32 7
  %21 = call ptr @ma_malloc(i64 noundef 744, ptr noundef %20)
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ma_sound, ptr %22, i32 0, i32 5
  store ptr %21, ptr %23, align 8, !tbaa !16
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ma_sound, ptr %24, i32 0, i32 5
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %3
  store i32 -4, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %132

29:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  call void @ma_resource_manager_pipeline_notifications_init(ptr dead_on_unwind writable sret(%struct.ma_resource_manager_pipeline_notifications) align 8 %13)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %13, i64 32, i1 false), !tbaa.struct !39
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ma_sound_config, ptr %30, i32 0, i32 14
  %32 = load ptr, ptr %31, align 8, !tbaa !40
  %33 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %11, i32 0, i32 1
  %34 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %33, i32 0, i32 1
  store ptr %32, ptr %34, align 8, !tbaa !41
  %35 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %11, i32 0, i32 1
  %36 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !41
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %44

39:                                               ; preds = %29
  %40 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %11, i32 0, i32 1
  %41 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !41
  %43 = call i32 @ma_fence_acquire(ptr noundef %42)
  br label %44

44:                                               ; preds = %39, %29
  call void @llvm.lifetime.start.p0(i64 72, ptr %14) #5
  call void @ma_resource_manager_data_source_config_init(ptr dead_on_unwind writable sret(%struct.ma_resource_manager_data_source_config) align 8 %14)
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ma_sound_config, ptr %45, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !44
  %48 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 0
  store ptr %47, ptr %48, align 8, !tbaa !45
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ma_sound_config, ptr %49, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !47
  %52 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 1
  store ptr %51, ptr %52, align 8, !tbaa !48
  %53 = load i32, ptr %9, align 4, !tbaa !15
  %54 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 9
  store i32 %53, ptr %54, align 4, !tbaa !49
  %55 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 2
  store ptr %11, ptr %55, align 8, !tbaa !50
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ma_sound_config, ptr %56, i32 0, i32 8
  %58 = load i64, ptr %57, align 8, !tbaa !51
  %59 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 3
  store i64 %58, ptr %59, align 8, !tbaa !52
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.ma_sound_config, ptr %60, i32 0, i32 9
  %62 = load i64, ptr %61, align 8, !tbaa !53
  %63 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 4
  store i64 %62, ptr %63, align 8, !tbaa !54
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ma_sound_config, ptr %64, i32 0, i32 10
  %66 = load i64, ptr %65, align 8, !tbaa !55
  %67 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 5
  store i64 %66, ptr %67, align 8, !tbaa !56
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ma_sound_config, ptr %68, i32 0, i32 11
  %70 = load i64, ptr %69, align 8, !tbaa !57
  %71 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 6
  store i64 %70, ptr %71, align 8, !tbaa !58
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ma_sound_config, ptr %72, i32 0, i32 12
  %74 = load i64, ptr %73, align 8, !tbaa !59
  %75 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 7
  store i64 %74, ptr %75, align 8, !tbaa !60
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ma_sound_config, ptr %76, i32 0, i32 13
  %78 = load i32, ptr %77, align 8, !tbaa !61
  %79 = getelementptr inbounds %struct.ma_resource_manager_data_source_config, ptr %14, i32 0, i32 8
  store i32 %78, ptr %79, align 8, !tbaa !62
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ma_engine, ptr %80, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !63
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ma_sound, ptr %83, i32 0, i32 5
  %85 = load ptr, ptr %84, align 8, !tbaa !16
  %86 = call i32 @ma_resource_manager_data_source_init_ex(ptr noundef %82, ptr noundef %14, ptr noundef %85)
  store i32 %86, ptr %8, align 4, !tbaa !9
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %44
  store i32 2, ptr %12, align 4
  br label %117

90:                                               ; preds = %44
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.ma_sound, ptr %91, i32 0, i32 4
  store i8 1, ptr %92, align 4, !tbaa !68
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %93, i64 104, i1 false), !tbaa.struct !69
  %94 = getelementptr inbounds %struct.ma_sound_config, ptr %10, i32 0, i32 0
  store ptr null, ptr %94, align 8, !tbaa !44
  %95 = getelementptr inbounds %struct.ma_sound_config, ptr %10, i32 0, i32 1
  store ptr null, ptr %95, align 8, !tbaa !47
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ma_sound, ptr %96, i32 0, i32 5
  %98 = load ptr, ptr %97, align 8, !tbaa !16
  %99 = getelementptr inbounds %struct.ma_sound_config, ptr %10, i32 0, i32 2
  store ptr %98, ptr %99, align 8, !tbaa !71
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = call noundef i32 @_ZL39ma_sound_init_from_data_source_internalP9ma_enginePK15ma_sound_configP8ma_sound(ptr noundef %100, ptr noundef %10, ptr noundef %101)
  store i32 %102, ptr %8, align 4, !tbaa !9
  %103 = load i32, ptr %8, align 4, !tbaa !9
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %116

105:                                              ; preds = %90
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ma_sound, ptr %106, i32 0, i32 5
  %108 = load ptr, ptr %107, align 8, !tbaa !16
  %109 = call i32 @ma_resource_manager_data_source_uninit(ptr noundef %108)
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ma_sound, ptr %110, i32 0, i32 5
  %112 = load ptr, ptr %111, align 8, !tbaa !16
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.ma_engine, ptr %113, i32 0, i32 7
  call void @ma_free(ptr noundef %112, ptr noundef %114)
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %115, i8 0, i64 824, i1 false)
  store i32 2, ptr %12, align 4
  br label %117

116:                                              ; preds = %90
  store i32 0, ptr %12, align 4
  br label %117

117:                                              ; preds = %116, %105, %89
  call void @llvm.lifetime.end.p0(i64 72, ptr %14) #5
  %118 = load i32, ptr %12, align 4
  switch i32 %118, label %132 [
    i32 0, label %119
    i32 2, label %120
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119, %117
  %121 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %11, i32 0, i32 1
  %122 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %121, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !41
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %130

125:                                              ; preds = %120
  %126 = getelementptr inbounds %struct.ma_resource_manager_pipeline_notifications, ptr %11, i32 0, i32 1
  %127 = getelementptr inbounds %struct.ma_resource_manager_pipeline_stage_notification, ptr %126, i32 0, i32 1
  %128 = load ptr, ptr %127, align 8, !tbaa !41
  %129 = call i32 @ma_fence_release(ptr noundef %128)
  br label %130

130:                                              ; preds = %125, %120
  %131 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %131, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %132

132:                                              ; preds = %130, %117, %28
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %133 = load i32, ptr %4, align 4
  ret i32 %133
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL39ma_sound_init_from_data_source_internalP9ma_enginePK15ma_sound_configP8ma_sound(ptr noundef, ptr noundef, 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 = !{!"_ZTS9ma_result", !7, i64 0}
!11 = !{!12, !13, i64 44}
!12 = !{!"_ZTS15ma_sound_config", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !13, i64 88, !6, i64 96}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!17, !6, i64 816}
!17 = !{!"_ZTS8ma_sound", !18, i64 0, !6, i64 792, !14, i64 800, !13, i64 808, !7, i64 812, !6, i64 816}
!18 = !{!"_ZTS14ma_engine_node", !19, i64 0, !6, i64 360, !13, i64 368, !22, i64 376, !26, i64 416, !30, i64 552, !37, i64 736, !25, i64 752, !25, i64 756, !25, i64 760, !13, i64 764, !13, i64 768, !13, i64 772, !7, i64 776, !6, i64 784}
!19 = !{!"_ZTS12ma_node_base", !6, i64 0, !6, i64 8, !6, i64 16, !20, i64 24, !20, i64 26, !20, i64 28, !20, i64 30, !21, i64 32, !7, i64 40, !14, i64 56, !13, i64 64, !13, i64 68, !6, i64 72, !6, i64 80, !7, i64 88, !7, i64 232, !6, i64 344, !13, i64 352}
!20 = !{!"short", !7, i64 0}
!21 = !{!"_ZTS13ma_node_state", !7, i64 0}
!22 = !{!"_ZTS8ma_fader", !23, i64 0, !25, i64 12, !25, i64 16, !14, i64 24, !14, i64 32}
!23 = !{!"_ZTS15ma_fader_config", !24, i64 0, !13, i64 4, !13, i64 8}
!24 = !{!"_ZTS9ma_format", !7, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{!"_ZTS19ma_linear_resampler", !27, i64 0, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !7, i64 48, !7, i64 56, !29, i64 64, !6, i64 120, !13, i64 128}
!27 = !{!"_ZTS26ma_linear_resampler_config", !24, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !28, i64 24}
!28 = !{!"double", !7, i64 0}
!29 = !{!"_ZTS6ma_lpf", !24, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !13, i64 48}
!30 = !{!"_ZTS14ma_spatializer", !13, i64 0, !13, i64 4, !6, i64 8, !31, i64 16, !32, i64 20, !33, i64 24, !25, i64 28, !25, i64 32, !25, i64 36, !25, i64 40, !25, i64 44, !25, i64 48, !25, i64 52, !25, i64 56, !25, i64 60, !25, i64 64, !13, i64 68, !34, i64 72, !34, i64 84, !34, i64 96, !25, i64 108, !35, i64 112, !6, i64 160, !6, i64 168, !13, i64 176}
!31 = !{!"_ZTS20ma_attenuation_model", !7, i64 0}
!32 = !{!"_ZTS14ma_positioning", !7, i64 0}
!33 = !{!"_ZTS13ma_handedness", !7, i64 0}
!34 = !{!"_ZTS8ma_vec3f", !25, i64 0, !25, i64 4, !25, i64 8}
!35 = !{!"_ZTS9ma_gainer", !36, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40}
!36 = !{!"_ZTS16ma_gainer_config", !13, i64 0, !13, i64 4}
!37 = !{!"_ZTS9ma_panner", !24, i64 0, !13, i64 4, !38, i64 8, !25, i64 12}
!38 = !{!"_ZTS11ma_pan_mode", !7, i64 0}
!39 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5}
!40 = !{!12, !6, i64 96}
!41 = !{!42, !6, i64 24}
!42 = !{!"_ZTS42ma_resource_manager_pipeline_notifications", !43, i64 0, !43, i64 16}
!43 = !{!"_ZTS47ma_resource_manager_pipeline_stage_notification", !6, i64 0, !6, i64 8}
!44 = !{!12, !6, i64 0}
!45 = !{!46, !6, i64 0}
!46 = !{!"_ZTS38ma_resource_manager_data_source_config", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !13, i64 64, !13, i64 68}
!47 = !{!12, !6, i64 8}
!48 = !{!46, !6, i64 8}
!49 = !{!46, !13, i64 68}
!50 = !{!46, !6, i64 16}
!51 = !{!12, !14, i64 48}
!52 = !{!46, !14, i64 24}
!53 = !{!12, !14, i64 56}
!54 = !{!46, !14, i64 32}
!55 = !{!12, !14, i64 64}
!56 = !{!46, !14, i64 40}
!57 = !{!12, !14, i64 72}
!58 = !{!46, !14, i64 48}
!59 = !{!12, !14, i64 80}
!60 = !{!46, !14, i64 56}
!61 = !{!12, !13, i64 88}
!62 = !{!46, !13, i64 64}
!63 = !{!64, !6, i64 728}
!64 = !{!"_ZTS9ma_engine", !65, i64 0, !6, i64 728, !6, i64 736, !6, i64 744, !13, i64 752, !13, i64 756, !7, i64 760, !66, i64 1176, !7, i64 1208, !7, i64 1209, !13, i64 1212, !6, i64 1216, !13, i64 1224, !13, i64 1228, !67, i64 1232}
!65 = !{!"_ZTS13ma_node_graph", !19, i64 0, !19, i64 360, !20, i64 720, !13, i64 724}
!66 = !{!"_ZTS23ma_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!67 = !{!"_ZTS22ma_mono_expansion_mode", !7, i64 0}
!68 = !{!17, !7, i64 812}
!69 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 4, !15, i64 36, i64 4, !15, i64 40, i64 4, !15, i64 44, i64 4, !15, i64 48, i64 8, !70, i64 56, i64 8, !70, i64 64, i64 8, !70, i64 72, i64 8, !70, i64 80, i64 8, !70, i64 88, i64 4, !15, i64 96, i64 8, !5}
!70 = !{!14, !14, i64 0}
!71 = !{!12, !6, i64 16}


; 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_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_sound_config = type { ptr, ptr, ptr, ptr, i32, i32, i32, i32, i64, i64, i64, i64, i64, i32, 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 uwtable
declare dso_local ptr @ma_malloc(i64 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 nounwind uwtable
declare dso_local i32 @ma_fence_acquire(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @ma_resource_manager_pipeline_notifications_init(ptr dead_on_unwind noalias writable sret(%struct.ma_resource_manager_pipeline_notifications) align 8) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @ma_resource_manager_data_source_config_init(ptr dead_on_unwind noalias writable sret(%struct.ma_resource_manager_data_source_config) align 8) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z32ma_sound_init_from_file_internalP9ma_enginePK15ma_sound_configP8ma_sound(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca %struct.ma_sound_config, align 8
  %5 = alloca %struct.ma_resource_manager_pipeline_notifications, align 8
  %6 = alloca %struct.ma_resource_manager_data_source_config, align 16
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  %7 = getelementptr inbounds i8, ptr %1, i64 44
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = or i32 %8, 8
  %10 = getelementptr inbounds i8, ptr %0, i64 1176
  %11 = tail call ptr @ma_malloc(i64 noundef 744, ptr noundef nonnull %10)
  %12 = getelementptr inbounds i8, ptr %2, i64 816
  store ptr %11, ptr %12, align 8, !tbaa !12
  %13 = icmp eq ptr %11, null
  br i1 %13, label %53, label %14

14:                                               ; preds = %3
  call void @ma_resource_manager_pipeline_notifications_init(ptr dead_on_unwind nonnull writable sret(%struct.ma_resource_manager_pipeline_notifications) align 8 %5)
  %15 = getelementptr inbounds i8, ptr %1, i64 96
  %16 = load ptr, ptr %15, align 8, !tbaa !35
  %17 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr %16, ptr %17, align 8, !tbaa !36
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %20, label %18

18:                                               ; preds = %14
  %19 = call i32 @ma_fence_acquire(ptr noundef nonnull %16)
  br label %20

20:                                               ; preds = %18, %14
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #5
  call void @ma_resource_manager_data_source_config_init(ptr dead_on_unwind nonnull writable sret(%struct.ma_resource_manager_data_source_config) align 8 %6)
  %21 = load <2 x ptr>, ptr %1, align 8, !tbaa !39
  store <2 x ptr> %21, ptr %6, align 16, !tbaa !39
  %22 = getelementptr inbounds i8, ptr %6, i64 68
  store i32 %9, ptr %22, align 4, !tbaa !40
  %23 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %5, ptr %23, align 16, !tbaa !42
  %24 = getelementptr inbounds i8, ptr %1, i64 48
  %25 = getelementptr inbounds i8, ptr %6, i64 24
  %26 = load <2 x i64>, ptr %24, align 8, !tbaa !43
  store <2 x i64> %26, ptr %25, align 8, !tbaa !43
  %27 = getelementptr inbounds i8, ptr %1, i64 64
  %28 = getelementptr inbounds i8, ptr %6, i64 40
  %29 = load <2 x i64>, ptr %27, align 8, !tbaa !43
  store <2 x i64> %29, ptr %28, align 8, !tbaa !43
  %30 = getelementptr inbounds i8, ptr %1, i64 80
  %31 = load i64, ptr %30, align 8, !tbaa !44
  %32 = getelementptr inbounds i8, ptr %6, i64 56
  store i64 %31, ptr %32, align 8, !tbaa !45
  %33 = getelementptr inbounds i8, ptr %1, i64 88
  %34 = load i32, ptr %33, align 8, !tbaa !46
  %35 = getelementptr inbounds i8, ptr %6, i64 64
  store i32 %34, ptr %35, align 16, !tbaa !47
  %36 = getelementptr inbounds i8, ptr %0, i64 728
  %37 = load ptr, ptr %36, align 8, !tbaa !48
  %38 = load ptr, ptr %12, align 8, !tbaa !12
  %39 = call i32 @ma_resource_manager_data_source_init_ex(ptr noundef %37, ptr noundef nonnull %6, ptr noundef %38)
  %.not35 = icmp eq i32 %39, 0
  br i1 %.not35, label %40, label %49

40:                                               ; preds = %20
  %41 = getelementptr inbounds i8, ptr %2, i64 812
  store i8 1, ptr %41, align 4, !tbaa !53
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %4, ptr noundef nonnull align 8 dereferenceable(104) %1, i64 104, i1 false), !tbaa.struct !54
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  %42 = load ptr, ptr %12, align 8, !tbaa !12
  %43 = getelementptr inbounds i8, ptr %4, i64 16
  store ptr %42, ptr %43, align 8, !tbaa !56
  %44 = call noundef i32 @_ZL39ma_sound_init_from_data_source_internalP9ma_enginePK15ma_sound_configP8ma_sound(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef nonnull %2)
  %.not36 = icmp eq i32 %44, 0
  br i1 %.not36, label %49, label %45

45:                                               ; preds = %40
  %46 = load ptr, ptr %12, align 8, !tbaa !12
  %47 = call i32 @ma_resource_manager_data_source_uninit(ptr noundef %46)
  %48 = load ptr, ptr %12, align 8, !tbaa !12
  call void @ma_free(ptr noundef %48, ptr noundef nonnull %10)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(824) %2, i8 0, i64 824, i1 false)
  br label %49

49:                                               ; preds = %40, %20, %45
  %.030 = phi i32 [ %44, %45 ], [ %39, %20 ], [ 0, %40 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #5
  %50 = load ptr, ptr %17, align 8, !tbaa !36
  %.not37 = icmp eq ptr %50, null
  br i1 %.not37, label %53, label %51

51:                                               ; preds = %49
  %52 = call i32 @ma_fence_release(ptr noundef nonnull %50)
  br label %53

53:                                               ; preds = %49, %51, %3
  %.029 = phi i32 [ -4, %3 ], [ %.030, %51 ], [ %.030, %49 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #5
  ret i32 %.029
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL39ma_sound_init_from_data_source_internalP9ma_enginePK15ma_sound_configP8ma_sound(ptr noundef, ptr noundef, 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, !10, i64 44}
!6 = !{!"_ZTS15ma_sound_config", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !10, i64 88, !7, i64 96}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!13, !7, i64 816}
!13 = !{!"_ZTS8ma_sound", !14, i64 0, !7, i64 792, !11, i64 800, !10, i64 808, !8, i64 812, !7, i64 816}
!14 = !{!"_ZTS14ma_engine_node", !15, i64 0, !7, i64 360, !10, i64 368, !18, i64 376, !22, i64 416, !26, i64 552, !33, i64 736, !21, i64 752, !21, i64 756, !21, i64 760, !10, i64 764, !10, i64 768, !10, i64 772, !8, i64 776, !7, i64 784}
!15 = !{!"_ZTS12ma_node_base", !7, i64 0, !7, i64 8, !7, i64 16, !16, i64 24, !16, i64 26, !16, i64 28, !16, i64 30, !17, i64 32, !8, i64 40, !11, i64 56, !10, i64 64, !10, i64 68, !7, i64 72, !7, i64 80, !8, i64 88, !8, i64 232, !7, i64 344, !10, i64 352}
!16 = !{!"short", !8, i64 0}
!17 = !{!"_ZTS13ma_node_state", !8, i64 0}
!18 = !{!"_ZTS8ma_fader", !19, i64 0, !21, i64 12, !21, i64 16, !11, i64 24, !11, i64 32}
!19 = !{!"_ZTS15ma_fader_config", !20, i64 0, !10, i64 4, !10, i64 8}
!20 = !{!"_ZTS9ma_format", !8, i64 0}
!21 = !{!"float", !8, i64 0}
!22 = !{!"_ZTS19ma_linear_resampler", !23, i64 0, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !8, i64 48, !8, i64 56, !25, i64 64, !7, i64 120, !10, i64 128}
!23 = !{!"_ZTS26ma_linear_resampler_config", !20, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !24, i64 24}
!24 = !{!"double", !8, i64 0}
!25 = !{!"_ZTS6ma_lpf", !20, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48}
!26 = !{!"_ZTS14ma_spatializer", !10, i64 0, !10, i64 4, !7, i64 8, !27, i64 16, !28, i64 20, !29, i64 24, !21, i64 28, !21, i64 32, !21, i64 36, !21, i64 40, !21, i64 44, !21, i64 48, !21, i64 52, !21, i64 56, !21, i64 60, !21, i64 64, !10, i64 68, !30, i64 72, !30, i64 84, !30, i64 96, !21, i64 108, !31, i64 112, !7, i64 160, !7, i64 168, !10, i64 176}
!27 = !{!"_ZTS20ma_attenuation_model", !8, i64 0}
!28 = !{!"_ZTS14ma_positioning", !8, i64 0}
!29 = !{!"_ZTS13ma_handedness", !8, i64 0}
!30 = !{!"_ZTS8ma_vec3f", !21, i64 0, !21, i64 4, !21, i64 8}
!31 = !{!"_ZTS9ma_gainer", !32, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40}
!32 = !{!"_ZTS16ma_gainer_config", !10, i64 0, !10, i64 4}
!33 = !{!"_ZTS9ma_panner", !20, i64 0, !10, i64 4, !34, i64 8, !21, i64 12}
!34 = !{!"_ZTS11ma_pan_mode", !8, i64 0}
!35 = !{!6, !7, i64 96}
!36 = !{!37, !7, i64 24}
!37 = !{!"_ZTS42ma_resource_manager_pipeline_notifications", !38, i64 0, !38, i64 16}
!38 = !{!"_ZTS47ma_resource_manager_pipeline_stage_notification", !7, i64 0, !7, i64 8}
!39 = !{!7, !7, i64 0}
!40 = !{!41, !10, i64 68}
!41 = !{!"_ZTS38ma_resource_manager_data_source_config", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !10, i64 64, !10, i64 68}
!42 = !{!41, !7, i64 16}
!43 = !{!11, !11, i64 0}
!44 = !{!6, !11, i64 80}
!45 = !{!41, !11, i64 56}
!46 = !{!6, !10, i64 88}
!47 = !{!41, !10, i64 64}
!48 = !{!49, !7, i64 728}
!49 = !{!"_ZTS9ma_engine", !50, i64 0, !7, i64 728, !7, i64 736, !7, i64 744, !10, i64 752, !10, i64 756, !8, i64 760, !51, i64 1176, !8, i64 1208, !8, i64 1209, !10, i64 1212, !7, i64 1216, !10, i64 1224, !10, i64 1228, !52, i64 1232}
!50 = !{!"_ZTS13ma_node_graph", !15, i64 0, !15, i64 360, !16, i64 720, !10, i64 724}
!51 = !{!"_ZTS23ma_allocation_callbacks", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!52 = !{!"_ZTS22ma_mono_expansion_mode", !8, i64 0}
!53 = !{!13, !8, i64 812}
!54 = !{i64 0, i64 8, !39, i64 8, i64 8, !39, i64 16, i64 8, !39, i64 24, i64 8, !39, i64 32, i64 4, !55, i64 36, i64 4, !55, i64 40, i64 4, !55, i64 44, i64 4, !55, i64 48, i64 8, !43, i64 56, i64 8, !43, i64 64, i64 8, !43, i64 72, i64 8, !43, i64 80, i64 8, !43, i64 88, i64 4, !55, i64 96, i64 8, !39}
!55 = !{!10, !10, i64 0}
!56 = !{!6, !7, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass