; 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_sound_config = type { ptr, ptr, ptr, ptr, i32, i32, i32, i32, i64, i64, i64, i64, i64, i32, 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_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_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_vec3f = type { float, float, float }
%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 }
%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_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_allocation_callbacks = type { 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: 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 uwtable
declare dso_local i32 @ma_resource_manager_data_source_init_copy(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 nounwind uwtable
declare dso_local void @ma_sound_config_init(ptr dead_on_unwind noalias writable sret(%struct.ma_sound_config) align 8) #4

; 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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_sound_init_copy(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %struct.ma_sound_config, align 8
  %14 = alloca i32, align 4
  %15 = alloca %struct.ma_sound_config, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 104, ptr %13) #5
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %11, align 8, !tbaa !5
  %18 = call noundef i32 @_ZL16ma_sound_preinitP9ma_engineP8ma_sound(ptr noundef %16, ptr noundef %17)
  store i32 %18, ptr %12, align 4, !tbaa !11
  %19 = load i32, ptr %12, align 4, !tbaa !11
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %23

21:                                               ; preds = %5
  %22 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %22, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %91

23:                                               ; preds = %5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  store i32 -2, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %91

27:                                               ; preds = %23
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ma_sound, ptr %28, i32 0, i32 5
  %30 = load ptr, ptr %29, align 8, !tbaa !13
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %27
  store i32 -3, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %91

33:                                               ; preds = %27
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ma_engine, ptr %34, i32 0, i32 7
  %36 = call ptr @ma_malloc(i64 noundef 744, ptr noundef %35)
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ma_sound, ptr %37, i32 0, i32 5
  store ptr %36, ptr %38, align 8, !tbaa !13
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ma_sound, ptr %39, i32 0, i32 5
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %33
  store i32 -4, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %91

44:                                               ; preds = %33
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ma_engine, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !37
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ma_sound, ptr %48, i32 0, i32 5
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ma_sound, ptr %51, i32 0, i32 5
  %53 = load ptr, ptr %52, align 8, !tbaa !13
  %54 = call i32 @ma_resource_manager_data_source_init_copy(ptr noundef %47, ptr noundef %50, ptr noundef %53)
  store i32 %54, ptr %12, align 4, !tbaa !11
  %55 = load i32, ptr %12, align 4, !tbaa !11
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %64

57:                                               ; preds = %44
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ma_sound, ptr %58, i32 0, i32 5
  %60 = load ptr, ptr %59, align 8, !tbaa !13
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ma_engine, ptr %61, i32 0, i32 7
  call void @ma_free(ptr noundef %60, ptr noundef %62)
  %63 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %63, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %91

64:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 104, ptr %15) #5
  call void @ma_sound_config_init(ptr dead_on_unwind writable sret(%struct.ma_sound_config) align 8 %15)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %15, i64 104, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 104, ptr %15) #5
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ma_sound, ptr %65, i32 0, i32 5
  %67 = load ptr, ptr %66, align 8, !tbaa !13
  %68 = getelementptr inbounds %struct.ma_sound_config, ptr %13, i32 0, i32 2
  store ptr %67, ptr %68, align 8, !tbaa !44
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = getelementptr inbounds %struct.ma_sound_config, ptr %13, i32 0, i32 7
  store i32 %69, ptr %70, align 4, !tbaa !46
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ma_sound_config, ptr %13, i32 0, i32 3
  store ptr %71, ptr %72, align 8, !tbaa !47
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = call noundef i32 @_ZL39ma_sound_init_from_data_source_internalP9ma_enginePK15ma_sound_configP8ma_sound(ptr noundef %73, ptr noundef %13, ptr noundef %74)
  store i32 %75, ptr %12, align 4, !tbaa !11
  %76 = load i32, ptr %12, align 4, !tbaa !11
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %90

78:                                               ; preds = %64
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ma_sound, ptr %79, i32 0, i32 5
  %81 = load ptr, ptr %80, align 8, !tbaa !13
  %82 = call i32 @ma_resource_manager_data_source_uninit(ptr noundef %81)
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ma_sound, ptr %83, i32 0, i32 5
  %85 = load ptr, ptr %84, align 8, !tbaa !13
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ma_engine, ptr %86, i32 0, i32 7
  call void @ma_free(ptr noundef %85, ptr noundef %87)
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %88, i8 0, i64 824, i1 false)
  %89 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %89, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %91

90:                                               ; preds = %64
  store i32 0, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %91

91:                                               ; preds = %90, %78, %57, %43, %32, %26, %21
  call void @llvm.lifetime.end.p0(i64 104, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %92 = load i32, ptr %6, align 4
  ret i32 %92
}

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

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, !12, i64 0}
!12 = !{!"_ZTS9ma_result", !7, i64 0}
!13 = !{!14, !6, i64 816}
!14 = !{!"_ZTS8ma_sound", !15, i64 0, !6, i64 792, !19, i64 800, !10, i64 808, !7, i64 812, !6, i64 816}
!15 = !{!"_ZTS14ma_engine_node", !16, i64 0, !6, i64 360, !10, i64 368, !20, i64 376, !24, i64 416, !28, i64 552, !35, i64 736, !23, i64 752, !23, i64 756, !23, i64 760, !10, i64 764, !10, i64 768, !10, i64 772, !7, i64 776, !6, i64 784}
!16 = !{!"_ZTS12ma_node_base", !6, i64 0, !6, i64 8, !6, i64 16, !17, i64 24, !17, i64 26, !17, i64 28, !17, i64 30, !18, i64 32, !7, i64 40, !19, i64 56, !10, i64 64, !10, i64 68, !6, i64 72, !6, i64 80, !7, i64 88, !7, i64 232, !6, i64 344, !10, i64 352}
!17 = !{!"short", !7, i64 0}
!18 = !{!"_ZTS13ma_node_state", !7, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!"_ZTS8ma_fader", !21, i64 0, !23, i64 12, !23, i64 16, !19, i64 24, !19, i64 32}
!21 = !{!"_ZTS15ma_fader_config", !22, i64 0, !10, i64 4, !10, i64 8}
!22 = !{!"_ZTS9ma_format", !7, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!"_ZTS19ma_linear_resampler", !25, i64 0, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48, !7, i64 56, !27, i64 64, !6, i64 120, !10, i64 128}
!25 = !{!"_ZTS26ma_linear_resampler_config", !22, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !26, i64 24}
!26 = !{!"double", !7, i64 0}
!27 = !{!"_ZTS6ma_lpf", !22, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48}
!28 = !{!"_ZTS14ma_spatializer", !10, i64 0, !10, i64 4, !6, i64 8, !29, i64 16, !30, i64 20, !31, i64 24, !23, i64 28, !23, i64 32, !23, i64 36, !23, i64 40, !23, i64 44, !23, i64 48, !23, i64 52, !23, i64 56, !23, i64 60, !23, i64 64, !10, i64 68, !32, i64 72, !32, i64 84, !32, i64 96, !23, i64 108, !33, i64 112, !6, i64 160, !6, i64 168, !10, i64 176}
!29 = !{!"_ZTS20ma_attenuation_model", !7, i64 0}
!30 = !{!"_ZTS14ma_positioning", !7, i64 0}
!31 = !{!"_ZTS13ma_handedness", !7, i64 0}
!32 = !{!"_ZTS8ma_vec3f", !23, i64 0, !23, i64 4, !23, i64 8}
!33 = !{!"_ZTS9ma_gainer", !34, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40}
!34 = !{!"_ZTS16ma_gainer_config", !10, i64 0, !10, i64 4}
!35 = !{!"_ZTS9ma_panner", !22, i64 0, !10, i64 4, !36, i64 8, !23, i64 12}
!36 = !{!"_ZTS11ma_pan_mode", !7, i64 0}
!37 = !{!38, !6, i64 728}
!38 = !{!"_ZTS9ma_engine", !39, i64 0, !6, i64 728, !6, i64 736, !6, i64 744, !10, i64 752, !10, i64 756, !7, i64 760, !40, i64 1176, !7, i64 1208, !7, i64 1209, !10, i64 1212, !6, i64 1216, !10, i64 1224, !10, i64 1228, !41, i64 1232}
!39 = !{!"_ZTS13ma_node_graph", !16, i64 0, !16, i64 360, !17, i64 720, !10, i64 724}
!40 = !{!"_ZTS23ma_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!41 = !{!"_ZTS22ma_mono_expansion_mode", !7, i64 0}
!42 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 4, !9, i64 36, i64 4, !9, i64 40, i64 4, !9, i64 44, i64 4, !9, 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, !9, i64 96, i64 8, !5}
!43 = !{!19, !19, i64 0}
!44 = !{!45, !6, i64 16}
!45 = !{!"_ZTS15ma_sound_config", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !19, i64 48, !19, i64 56, !19, i64 64, !19, i64 72, !19, i64 80, !10, i64 88, !6, i64 96}
!46 = !{!45, !10, i64 44}
!47 = !{!45, !6, i64 24}


; 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_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 uwtable
declare dso_local i32 @ma_resource_manager_data_source_init_copy(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 nounwind uwtable
declare dso_local void @ma_sound_config_init(ptr dead_on_unwind noalias writable sret(%struct.ma_sound_config) align 8) local_unnamed_addr #3

; 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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_sound_init_copy(ptr noundef %0, ptr noundef readonly %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = alloca %struct.ma_sound_config, align 8
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %6) #4
  %7 = tail call noundef i32 @_ZL16ma_sound_preinitP9ma_engineP8ma_sound(ptr noundef %0, ptr noundef %4)
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %8, label %36

8:                                                ; preds = %5
  %9 = icmp eq ptr %1, null
  br i1 %9, label %36, label %10

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %1, i64 816
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %36, label %14

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 1176
  %16 = tail call ptr @ma_malloc(i64 noundef 744, ptr noundef nonnull %15)
  %17 = getelementptr inbounds i8, ptr %4, i64 816
  store ptr %16, ptr %17, align 8, !tbaa !5
  %18 = icmp eq ptr %16, null
  br i1 %18, label %36, label %19

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 728
  %21 = load ptr, ptr %20, align 8, !tbaa !33
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = tail call i32 @ma_resource_manager_data_source_init_copy(ptr noundef %21, ptr noundef %22, ptr noundef nonnull %16)
  %.not32 = icmp eq i32 %23, 0
  br i1 %.not32, label %26, label %24

24:                                               ; preds = %19
  %25 = load ptr, ptr %17, align 8, !tbaa !5
  tail call void @ma_free(ptr noundef %25, ptr noundef nonnull %15)
  br label %36

26:                                               ; preds = %19
  call void @ma_sound_config_init(ptr dead_on_unwind nonnull writable sret(%struct.ma_sound_config) align 8 %6)
  %27 = load ptr, ptr %17, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %27, ptr %28, align 8, !tbaa !38
  %29 = getelementptr inbounds i8, ptr %6, i64 44
  store i32 %2, ptr %29, align 4, !tbaa !40
  %30 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %3, ptr %30, align 8, !tbaa !41
  %31 = call noundef i32 @_ZL39ma_sound_init_from_data_source_internalP9ma_enginePK15ma_sound_configP8ma_sound(ptr noundef nonnull %0, ptr noundef nonnull %6, ptr noundef nonnull %4)
  %.not33 = icmp eq i32 %31, 0
  br i1 %.not33, label %36, label %32

32:                                               ; preds = %26
  %33 = load ptr, ptr %17, align 8, !tbaa !5
  %34 = call i32 @ma_resource_manager_data_source_uninit(ptr noundef %33)
  %35 = load ptr, ptr %17, align 8, !tbaa !5
  call void @ma_free(ptr noundef %35, ptr noundef nonnull %15)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(824) %4, i8 0, i64 824, i1 false)
  br label %36

36:                                               ; preds = %26, %14, %10, %8, %5, %32, %24
  %.0 = phi i32 [ %23, %24 ], [ %31, %32 ], [ %7, %5 ], [ -2, %8 ], [ -3, %10 ], [ -4, %14 ], [ 0, %26 ]
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %6) #4
  ret i32 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL16ma_sound_preinitP9ma_engineP8ma_sound(ptr noundef, ptr noundef) local_unnamed_addr #3

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 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 #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !9, i64 816}
!6 = !{!"_ZTS8ma_sound", !7, i64 0, !9, i64 792, !14, i64 800, !15, i64 808, !10, i64 812, !9, i64 816}
!7 = !{!"_ZTS14ma_engine_node", !8, i64 0, !9, i64 360, !15, i64 368, !16, i64 376, !20, i64 416, !24, i64 552, !31, i64 736, !19, i64 752, !19, i64 756, !19, i64 760, !15, i64 764, !15, i64 768, !15, i64 772, !10, i64 776, !9, i64 784}
!8 = !{!"_ZTS12ma_node_base", !9, i64 0, !9, i64 8, !9, i64 16, !12, i64 24, !12, i64 26, !12, i64 28, !12, i64 30, !13, i64 32, !10, i64 40, !14, i64 56, !15, i64 64, !15, i64 68, !9, i64 72, !9, i64 80, !10, i64 88, !10, i64 232, !9, i64 344, !15, i64 352}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"short", !10, i64 0}
!13 = !{!"_ZTS13ma_node_state", !10, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = !{!"int", !10, i64 0}
!16 = !{!"_ZTS8ma_fader", !17, i64 0, !19, i64 12, !19, i64 16, !14, i64 24, !14, i64 32}
!17 = !{!"_ZTS15ma_fader_config", !18, i64 0, !15, i64 4, !15, i64 8}
!18 = !{!"_ZTS9ma_format", !10, i64 0}
!19 = !{!"float", !10, i64 0}
!20 = !{!"_ZTS19ma_linear_resampler", !21, i64 0, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !10, i64 48, !10, i64 56, !23, i64 64, !9, i64 120, !15, i64 128}
!21 = !{!"_ZTS26ma_linear_resampler_config", !18, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !22, i64 24}
!22 = !{!"double", !10, i64 0}
!23 = !{!"_ZTS6ma_lpf", !18, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !9, i64 24, !9, i64 32, !9, i64 40, !15, i64 48}
!24 = !{!"_ZTS14ma_spatializer", !15, i64 0, !15, i64 4, !9, i64 8, !25, i64 16, !26, i64 20, !27, i64 24, !19, i64 28, !19, i64 32, !19, i64 36, !19, i64 40, !19, i64 44, !19, i64 48, !19, i64 52, !19, i64 56, !19, i64 60, !19, i64 64, !15, i64 68, !28, i64 72, !28, i64 84, !28, i64 96, !19, i64 108, !29, i64 112, !9, i64 160, !9, i64 168, !15, i64 176}
!25 = !{!"_ZTS20ma_attenuation_model", !10, i64 0}
!26 = !{!"_ZTS14ma_positioning", !10, i64 0}
!27 = !{!"_ZTS13ma_handedness", !10, i64 0}
!28 = !{!"_ZTS8ma_vec3f", !19, i64 0, !19, i64 4, !19, i64 8}
!29 = !{!"_ZTS9ma_gainer", !30, i64 0, !15, i64 8, !9, i64 16, !9, i64 24, !9, i64 32, !15, i64 40}
!30 = !{!"_ZTS16ma_gainer_config", !15, i64 0, !15, i64 4}
!31 = !{!"_ZTS9ma_panner", !18, i64 0, !15, i64 4, !32, i64 8, !19, i64 12}
!32 = !{!"_ZTS11ma_pan_mode", !10, i64 0}
!33 = !{!34, !9, i64 728}
!34 = !{!"_ZTS9ma_engine", !35, i64 0, !9, i64 728, !9, i64 736, !9, i64 744, !15, i64 752, !15, i64 756, !10, i64 760, !36, i64 1176, !10, i64 1208, !10, i64 1209, !15, i64 1212, !9, i64 1216, !15, i64 1224, !15, i64 1228, !37, i64 1232}
!35 = !{!"_ZTS13ma_node_graph", !8, i64 0, !8, i64 360, !12, i64 720, !15, i64 724}
!36 = !{!"_ZTS23ma_allocation_callbacks", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!37 = !{!"_ZTS22ma_mono_expansion_mode", !10, i64 0}
!38 = !{!39, !9, i64 16}
!39 = !{!"_ZTS15ma_sound_config", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !15, i64 88, !9, i64 96}
!40 = !{!39, !15, i64 44}
!41 = !{!39, !9, i64 24}


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