; 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_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_inlined = type { %struct.ma_sound, 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 void @ma_free(ptr noundef, ptr noundef) #1

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @ma_engine_uninit(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %9

8:                                                ; preds = %1
  store i32 1, ptr %4, align 4
  br label %99

9:                                                ; preds = %1
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.ma_engine, ptr %10, i32 0, i32 9
  %12 = load i8, ptr %11, align 1, !tbaa !9
  %13 = icmp ne i8 %12, 0
  br i1 %13, label %14, label %23

14:                                               ; preds = %9
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.ma_engine, ptr %15, i32 0, i32 2
  %17 = load ptr, ptr %16, align 8, !tbaa !19
  call void @ma_device_uninit(ptr noundef %17)
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ma_engine, ptr %18, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !19
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.ma_engine, ptr %21, i32 0, i32 7
  call void @ma_free(ptr noundef %20, ptr noundef %22)
  br label %34

23:                                               ; preds = %9
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ma_engine, ptr %24, i32 0, i32 2
  %26 = load ptr, ptr %25, align 8, !tbaa !19
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %33

28:                                               ; preds = %23
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ma_engine, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = call i32 @ma_device_stop(ptr noundef %31)
  br label %33

33:                                               ; preds = %28, %23
  br label %34

34:                                               ; preds = %33, %14
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ma_engine, ptr %35, i32 0, i32 10
  %37 = call i32 @ma_spinlock_lock(ptr noundef %36)
  br label %38

38:                                               ; preds = %58, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ma_engine, ptr %39, i32 0, i32 11
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  store ptr %41, ptr %5, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = icmp eq ptr %42, null
  br i1 %43, label %44, label %45

44:                                               ; preds = %38
  store i32 2, ptr %4, align 4
  br label %56

45:                                               ; preds = %38
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ma_sound_inlined, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ma_engine, ptr %49, i32 0, i32 11
  store ptr %48, ptr %50, align 8, !tbaa !20
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ma_sound_inlined, ptr %51, i32 0, i32 0
  call void @ma_sound_uninit(ptr noundef %52)
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ma_engine, ptr %54, i32 0, i32 7
  call void @ma_free(ptr noundef %53, ptr noundef %55)
  store i32 0, ptr %4, align 4
  br label %56

56:                                               ; preds = %45, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %57 = load i32, ptr %4, align 4
  switch i32 %57, label %102 [
    i32 0, label %58
    i32 2, label %59
  ]

58:                                               ; preds = %56
  br label %38, !llvm.loop !42

59:                                               ; preds = %56
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.ma_engine, ptr %60, i32 0, i32 10
  %62 = call i32 @ma_spinlock_unlock(ptr noundef %61)
  store i32 0, ptr %3, align 4, !tbaa !44
  br label %63

63:                                               ; preds = %77, %59
  %64 = load i32, ptr %3, align 4, !tbaa !44
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ma_engine, ptr %65, i32 0, i32 5
  %67 = load i32, ptr %66, align 4, !tbaa !45
  %68 = icmp ult i32 %64, %67
  br i1 %68, label %69, label %80

69:                                               ; preds = %63
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ma_engine, ptr %70, i32 0, i32 6
  %72 = load i32, ptr %3, align 4, !tbaa !44
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds [4 x %struct.ma_spatializer_listener], ptr %71, i64 0, i64 %73
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ma_engine, ptr %75, i32 0, i32 7
  call void @ma_spatializer_listener_uninit(ptr noundef %74, ptr noundef %76)
  br label %77

77:                                               ; preds = %69
  %78 = load i32, ptr %3, align 4, !tbaa !44
  %79 = add i32 %78, 1
  store i32 %79, ptr %3, align 4, !tbaa !44
  br label %63, !llvm.loop !46

80:                                               ; preds = %63
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ma_engine, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ma_engine, ptr %83, i32 0, i32 7
  call void @ma_node_graph_uninit(ptr noundef %82, ptr noundef %84)
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ma_engine, ptr %85, i32 0, i32 8
  %87 = load i8, ptr %86, align 8, !tbaa !47
  %88 = icmp ne i8 %87, 0
  br i1 %88, label %89, label %98

89:                                               ; preds = %80
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ma_engine, ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !48
  call void @ma_resource_manager_uninit(ptr noundef %92)
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ma_engine, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !48
  %96 = load ptr, ptr %2, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ma_engine, ptr %96, i32 0, i32 7
  call void @ma_free(ptr noundef %95, ptr noundef %97)
  br label %98

98:                                               ; preds = %89, %80
  store i32 0, ptr %4, align 4
  br label %99

99:                                               ; preds = %98, %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  %100 = load i32, ptr %4, align 4
  switch i32 %100, label %102 [
    i32 0, label %101
    i32 1, label %101
  ]

101:                                              ; preds = %99, %99
  ret void

102:                                              ; preds = %99, %56
  unreachable
}

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


; 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_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 }

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @ma_engine_uninit(ptr noundef %0) local_unnamed_addr #0 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %44, label %3

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 1209
  %5 = load i8, ptr %4, align 1, !tbaa !5
  %.not = icmp eq i8 %5, 0
  %6 = getelementptr inbounds i8, ptr %0, i64 736
  %7 = load ptr, ptr %6, align 8, !tbaa !18
  br i1 %.not, label %11, label %8

8:                                                ; preds = %3
  tail call void @ma_device_uninit(ptr noundef %7)
  %9 = load ptr, ptr %6, align 8, !tbaa !18
  %10 = getelementptr inbounds i8, ptr %0, i64 1176
  tail call void @ma_free(ptr noundef %9, ptr noundef nonnull %10)
  br label %14

11:                                               ; preds = %3
  %.not32 = icmp eq ptr %7, null
  br i1 %.not32, label %14, label %12

12:                                               ; preds = %11
  %13 = tail call i32 @ma_device_stop(ptr noundef nonnull %7)
  br label %14

14:                                               ; preds = %11, %12, %8
  %15 = getelementptr inbounds i8, ptr %0, i64 1212
  %16 = tail call i32 @ma_spinlock_lock(ptr noundef nonnull %15)
  %17 = getelementptr inbounds i8, ptr %0, i64 1216
  %18 = load ptr, ptr %17, align 8, !tbaa !19
  %19 = icmp eq ptr %18, null
  br i1 %19, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 1176
  br label %21

21:                                               ; preds = %.lr.ph, %21
  %22 = phi ptr [ %18, %.lr.ph ], [ %25, %21 ]
  %23 = getelementptr inbounds i8, ptr %22, i64 824
  %24 = load ptr, ptr %23, align 8, !tbaa !20
  store ptr %24, ptr %17, align 8, !tbaa !19
  tail call void @ma_sound_uninit(ptr noundef nonnull %22)
  tail call void @ma_free(ptr noundef nonnull %22, ptr noundef nonnull %20)
  %25 = load ptr, ptr %17, align 8, !tbaa !19
  %26 = icmp eq ptr %25, null
  br i1 %26, label %._crit_edge, label %21

._crit_edge:                                      ; preds = %21, %14
  %27 = tail call i32 @ma_spinlock_unlock(ptr noundef nonnull %15)
  %28 = getelementptr inbounds i8, ptr %0, i64 756
  %29 = load i32, ptr %28, align 4, !tbaa !41
  %.not40 = icmp eq i32 %29, 0
  br i1 %.not40, label %._crit_edge39, label %.lr.ph38

.lr.ph38:                                         ; preds = %._crit_edge
  %30 = getelementptr inbounds i8, ptr %0, i64 760
  %31 = getelementptr inbounds i8, ptr %0, i64 1176
  br label %32

32:                                               ; preds = %.lr.ph38, %32
  %indvars.iv = phi i64 [ 0, %.lr.ph38 ], [ %indvars.iv.next, %32 ]
  %33 = getelementptr inbounds [4 x %struct.ma_spatializer_listener], ptr %30, i64 0, i64 %indvars.iv
  tail call void @ma_spatializer_listener_uninit(ptr noundef nonnull %33, ptr noundef nonnull %31)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %28, align 4, !tbaa !41
  %35 = zext i32 %34 to i64
  %36 = icmp ult i64 %indvars.iv.next, %35
  br i1 %36, label %32, label %._crit_edge39, !llvm.loop !42

._crit_edge39:                                    ; preds = %32, %._crit_edge
  %37 = getelementptr inbounds i8, ptr %0, i64 1176
  tail call void @ma_node_graph_uninit(ptr noundef nonnull %0, ptr noundef nonnull %37)
  %38 = getelementptr inbounds i8, ptr %0, i64 1208
  %39 = load i8, ptr %38, align 8, !tbaa !44
  %.not33 = icmp eq i8 %39, 0
  br i1 %.not33, label %44, label %40

40:                                               ; preds = %._crit_edge39
  %41 = getelementptr inbounds i8, ptr %0, i64 728
  %42 = load ptr, ptr %41, align 8, !tbaa !45
  tail call void @ma_resource_manager_uninit(ptr noundef %42)
  %43 = load ptr, ptr %41, align 8, !tbaa !45
  tail call void @ma_free(ptr noundef %43, ptr noundef nonnull %37)
  br label %44

44:                                               ; preds = %._crit_edge39, %40, %1
  ret void
}

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass