; 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 ptr @ma_malloc(i64 noundef, ptr noundef) #1

; 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 nounwind uwtable
declare dso_local ptr @ma_node_graph_get_endpoint(ptr noundef) #2

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

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

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

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

26:                                               ; preds = %23, %4
  store i32 -2, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %198

27:                                               ; preds = %23
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %34

30:                                               ; preds = %27
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ma_engine, ptr %31, i32 0, i32 0
  %33 = call ptr @ma_node_graph_get_endpoint(ptr noundef %32)
  store ptr %33, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %30, %27
  %35 = load ptr, ptr %6, 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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i32 0, ptr %14, align 4, !tbaa !9
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ma_engine, ptr %38, i32 0, i32 11
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  store ptr %40, ptr %12, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %57, %34
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %61

44:                                               ; preds = %41
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ma_sound_inlined, ptr %45, i32 0, i32 0
  %47 = call i32 @ma_sound_at_end(ptr noundef %46)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %56

49:                                               ; preds = %44
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %50, ptr %11, align 8, !tbaa !5
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ma_engine, ptr %51, i32 0, i32 12
  store i32 1, ptr %15, align 4, !tbaa !9
  %53 = load i32, ptr %15, align 4
  %54 = atomicrmw sub ptr %52, i32 %53 seq_cst, align 8
  store i32 %54, ptr %16, align 4
  %55 = load i32, ptr %16, align 4, !tbaa !9
  br label %61

56:                                               ; preds = %44
  br label %57

57:                                               ; preds = %56
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ma_sound_inlined, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  store ptr %60, ptr %12, align 8, !tbaa !5
  br label %41, !llvm.loop !43

61:                                               ; preds = %49, %41
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %105

64:                                               ; preds = %61
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ma_engine, ptr %65, i32 0, i32 11
  %67 = load ptr, ptr %66, align 8, !tbaa !13
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = icmp eq ptr %67, %68
  br i1 %69, label %70, label %76

70:                                               ; preds = %64
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ma_sound_inlined, ptr %71, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !22
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.ma_engine, ptr %74, i32 0, i32 11
  store ptr %73, ptr %75, align 8, !tbaa !13
  br label %76

76:                                               ; preds = %70, %64
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ma_sound_inlined, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !45
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %89

81:                                               ; preds = %76
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ma_sound_inlined, ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !22
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ma_sound_inlined, ptr %85, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !45
  %88 = getelementptr inbounds %struct.ma_sound_inlined, ptr %87, i32 0, i32 1
  store ptr %84, ptr %88, align 8, !tbaa !22
  br label %89

89:                                               ; preds = %81, %76
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ma_sound_inlined, ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !22
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %102

94:                                               ; preds = %89
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.ma_sound_inlined, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !45
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ma_sound_inlined, ptr %98, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !22
  %101 = getelementptr inbounds %struct.ma_sound_inlined, ptr %100, i32 0, i32 2
  store ptr %97, ptr %101, align 8, !tbaa !45
  br label %102

102:                                              ; preds = %94, %89
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ma_sound_inlined, ptr %103, i32 0, i32 0
  call void @ma_sound_uninit(ptr noundef %104)
  br label %109

105:                                              ; preds = %61
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ma_engine, ptr %106, i32 0, i32 7
  %108 = call ptr @ma_malloc(i64 noundef 840, ptr noundef %107)
  store ptr %108, ptr %11, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %105, %102
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %168

112:                                              ; preds = %109
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = or i32 %113, 4
  store i32 %114, ptr %14, align 4, !tbaa !9
  %115 = load i32, ptr %14, align 4, !tbaa !9
  %116 = or i32 %115, 16
  store i32 %116, ptr %14, align 4, !tbaa !9
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = or i32 %117, 32
  store i32 %118, ptr %14, align 4, !tbaa !9
  %119 = load i32, ptr %14, align 4, !tbaa !9
  %120 = or i32 %119, 64
  store i32 %120, ptr %14, align 4, !tbaa !9
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load i32, ptr %14, align 4, !tbaa !9
  %124 = load ptr, ptr %11, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.ma_sound_inlined, ptr %124, i32 0, i32 0
  %126 = call i32 @ma_sound_init_from_file(ptr noundef %121, ptr noundef %122, i32 noundef %123, ptr noundef null, ptr noundef null, ptr noundef %125)
  store i32 %126, ptr %10, align 4, !tbaa !11
  %127 = load i32, ptr %10, align 4, !tbaa !11
  %128 = icmp eq i32 %127, 0
  br i1 %128, label %129, label %163

129:                                              ; preds = %112
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = load i32, ptr %9, align 4, !tbaa !9
  %133 = call i32 @ma_node_attach_output_bus(ptr noundef %130, i32 noundef 0, ptr noundef %131, i32 noundef %132)
  store i32 %133, ptr %10, align 4, !tbaa !11
  %134 = load i32, ptr %10, align 4, !tbaa !11
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %136, label %158

136:                                              ; preds = %129
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.ma_engine, ptr %137, i32 0, i32 11
  %139 = load ptr, ptr %138, align 8, !tbaa !13
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.ma_sound_inlined, ptr %140, i32 0, i32 1
  store ptr %139, ptr %141, align 8, !tbaa !22
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ma_sound_inlined, ptr %142, i32 0, i32 2
  store ptr null, ptr %143, align 8, !tbaa !45
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.ma_engine, ptr %145, i32 0, i32 11
  store ptr %144, ptr %146, align 8, !tbaa !13
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ma_sound_inlined, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !22
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %157

151:                                              ; preds = %136
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  %153 = load ptr, ptr %11, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ma_sound_inlined, ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !22
  %156 = getelementptr inbounds %struct.ma_sound_inlined, ptr %155, i32 0, i32 2
  store ptr %152, ptr %156, align 8, !tbaa !45
  br label %157

157:                                              ; preds = %151, %136
  br label %162

158:                                              ; preds = %129
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.ma_engine, ptr %160, i32 0, i32 7
  call void @ma_free(ptr noundef %159, ptr noundef %161)
  br label %162

162:                                              ; preds = %158, %157
  br label %167

163:                                              ; preds = %112
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.ma_engine, ptr %165, i32 0, i32 7
  call void @ma_free(ptr noundef %164, ptr noundef %166)
  br label %167

167:                                              ; preds = %163, %162
  br label %169

168:                                              ; preds = %109
  store i32 -4, ptr %10, align 4, !tbaa !11
  br label %169

169:                                              ; preds = %168, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.ma_engine, ptr %170, i32 0, i32 10
  %172 = call i32 @ma_spinlock_unlock(ptr noundef %171)
  %173 = load i32, ptr %10, align 4, !tbaa !11
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %175, label %177

175:                                              ; preds = %169
  %176 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %176, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %198

177:                                              ; preds = %169
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.ma_sound_inlined, ptr %178, i32 0, i32 0
  %180 = call i32 @ma_sound_start(ptr noundef %179)
  store i32 %180, ptr %10, align 4, !tbaa !11
  %181 = load i32, ptr %10, align 4, !tbaa !11
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %183, label %191

183:                                              ; preds = %177
  %184 = load ptr, ptr %11, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.ma_sound_inlined, ptr %184, i32 0, i32 0
  %186 = getelementptr inbounds %struct.ma_sound, ptr %185, i32 0, i32 3
  store i32 1, ptr %17, align 4, !tbaa !9
  %187 = load i32, ptr %17, align 4
  %188 = atomicrmw xchg ptr %186, i32 %187 seq_cst, align 8
  store i32 %188, ptr %18, align 4
  %189 = load i32, ptr %18, align 4, !tbaa !9
  %190 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %190, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %198

191:                                              ; preds = %177
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.ma_engine, ptr %192, i32 0, i32 12
  store i32 1, ptr %19, align 4, !tbaa !9
  %194 = load i32, ptr %19, align 4
  %195 = atomicrmw add ptr %193, i32 %194 seq_cst, align 8
  store i32 %195, ptr %20, align 4
  %196 = load i32, ptr %20, align 4, !tbaa !9
  %197 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %197, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %198

198:                                              ; preds = %191, %183, %175, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %199 = load i32, ptr %5, align 4
  ret i32 %199
}

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

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

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


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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_engine_play_sound_ex(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = icmp eq ptr %0, null
  %6 = icmp eq ptr %1, null
  %or.cond = or i1 %5, %6
  br i1 %or.cond, label %58, label %7

7:                                                ; preds = %4
  %8 = icmp eq ptr %2, null
  br i1 %8, label %9, label %11

9:                                                ; preds = %7
  %10 = tail call ptr @ma_node_graph_get_endpoint(ptr noundef nonnull %0)
  br label %11

11:                                               ; preds = %9, %7
  %.067 = phi i32 [ 0, %9 ], [ %3, %7 ]
  %.066 = phi ptr [ %10, %9 ], [ %2, %7 ]
  %12 = getelementptr inbounds i8, ptr %0, i64 1212
  %13 = tail call i32 @ma_spinlock_lock(ptr noundef nonnull %12)
  %14 = getelementptr inbounds i8, ptr %0, i64 1216
  %.070102 = load ptr, ptr %14, align 8, !tbaa !5
  %.not103 = icmp eq ptr %.070102, null
  br i1 %.not103, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11, %16
  %.070104 = phi ptr [ %.070, %16 ], [ %.070102, %11 ]
  %15 = tail call i32 @ma_sound_at_end(ptr noundef nonnull %.070104)
  %.not82 = icmp eq i32 %15, 0
  br i1 %.not82, label %16, label %18

16:                                               ; preds = %.lr.ph
  %17 = getelementptr inbounds i8, ptr %.070104, i64 824
  %.070 = load ptr, ptr %17, align 8, !tbaa !5
  %.not = icmp eq ptr %.070, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

18:                                               ; preds = %.lr.ph
  %19 = getelementptr inbounds i8, ptr %0, i64 1224
  %20 = atomicrmw sub ptr %19, i32 1 seq_cst, align 8
  %21 = load ptr, ptr %14, align 8, !tbaa !11
  %22 = icmp eq ptr %21, %.070104
  br i1 %22, label %23, label %26

23:                                               ; preds = %18
  %24 = getelementptr inbounds i8, ptr %.070104, i64 824
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  store ptr %25, ptr %14, align 8, !tbaa !11
  br label %26

26:                                               ; preds = %23, %18
  %27 = getelementptr inbounds i8, ptr %.070104, i64 832
  %28 = load ptr, ptr %27, align 8, !tbaa !42
  %.not84 = icmp eq ptr %28, null
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.070104, i64 824
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !21
  br i1 %.not84, label %._crit_edge106, label %29

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %28, i64 824
  store ptr %.pre, ptr %30, align 8, !tbaa !21
  br label %._crit_edge106

._crit_edge106:                                   ; preds = %26, %29
  %.not85 = icmp eq ptr %.pre, null
  br i1 %.not85, label %.thread92, label %31

31:                                               ; preds = %._crit_edge106
  %32 = getelementptr inbounds i8, ptr %.pre, i64 832
  store ptr %28, ptr %32, align 8, !tbaa !42
  br label %.thread92

.thread92:                                        ; preds = %._crit_edge106, %31
  tail call void @ma_sound_uninit(ptr noundef nonnull %.070104)
  br label %35

._crit_edge:                                      ; preds = %16, %11
  %33 = getelementptr inbounds i8, ptr %0, i64 1176
  %34 = tail call ptr @ma_malloc(i64 noundef 840, ptr noundef nonnull %33)
  %.not86 = icmp eq ptr %34, null
  br i1 %.not86, label %.thread97, label %35

35:                                               ; preds = %.thread92, %._crit_edge
  %.195 = phi ptr [ %.070104, %.thread92 ], [ %34, %._crit_edge ]
  %36 = tail call i32 @ma_sound_init_from_file(ptr noundef %0, ptr noundef %1, i32 noundef 116, ptr noundef null, ptr noundef null, ptr noundef nonnull %.195)
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %.thread97.sink.split

38:                                               ; preds = %35
  %39 = tail call i32 @ma_node_attach_output_bus(ptr noundef nonnull %.195, i32 noundef 0, ptr noundef %.066, i32 noundef %.067)
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %.thread97.sink.split

41:                                               ; preds = %38
  %42 = load ptr, ptr %14, align 8, !tbaa !11
  %43 = getelementptr inbounds i8, ptr %.195, i64 824
  store ptr %42, ptr %43, align 8, !tbaa !21
  %44 = getelementptr inbounds i8, ptr %.195, i64 832
  store ptr null, ptr %44, align 8, !tbaa !42
  store ptr %.195, ptr %14, align 8, !tbaa !11
  %.not87 = icmp eq ptr %42, null
  br i1 %.not87, label %49, label %45

45:                                               ; preds = %41
  %46 = getelementptr inbounds i8, ptr %42, i64 832
  store ptr %.195, ptr %46, align 8, !tbaa !42
  br label %49

.thread97.sink.split:                             ; preds = %35, %38
  %.068.ph.ph = phi i32 [ %39, %38 ], [ %36, %35 ]
  %47 = getelementptr inbounds i8, ptr %0, i64 1176
  tail call void @ma_free(ptr noundef nonnull %.195, ptr noundef nonnull %47)
  br label %.thread97

.thread97:                                        ; preds = %.thread97.sink.split, %._crit_edge
  %.068.ph = phi i32 [ -4, %._crit_edge ], [ %.068.ph.ph, %.thread97.sink.split ]
  %48 = tail call i32 @ma_spinlock_unlock(ptr noundef nonnull %12)
  br label %58

49:                                               ; preds = %45, %41
  %50 = tail call i32 @ma_spinlock_unlock(ptr noundef nonnull %12)
  %51 = tail call i32 @ma_sound_start(ptr noundef nonnull %.195)
  %.not89 = icmp eq i32 %51, 0
  br i1 %.not89, label %55, label %52

52:                                               ; preds = %49
  %53 = getelementptr inbounds i8, ptr %.195, i64 808
  %54 = atomicrmw xchg ptr %53, i32 1 seq_cst, align 8
  br label %58

55:                                               ; preds = %49
  %56 = getelementptr inbounds i8, ptr %0, i64 1224
  %57 = atomicrmw add ptr %56, i32 1 seq_cst, align 8
  br label %58

58:                                               ; preds = %.thread97, %4, %55, %52
  %.0 = phi i32 [ %51, %52 ], [ 0, %55 ], [ -2, %4 ], [ %.068.ph, %.thread97 ]
  ret i32 %.0
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @ma_sound_start(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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 1216}
!12 = !{!"_ZTS9ma_engine", !13, i64 0, !6, i64 728, !6, i64 736, !6, i64 744, !18, i64 752, !18, i64 756, !7, i64 760, !19, i64 1176, !7, i64 1208, !7, i64 1209, !18, i64 1212, !6, i64 1216, !18, i64 1224, !18, i64 1228, !20, i64 1232}
!13 = !{!"_ZTS13ma_node_graph", !14, i64 0, !14, i64 360, !15, i64 720, !18, i64 724}
!14 = !{!"_ZTS12ma_node_base", !6, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !15, i64 26, !15, i64 28, !15, i64 30, !16, i64 32, !7, i64 40, !17, i64 56, !18, i64 64, !18, i64 68, !6, i64 72, !6, i64 80, !7, i64 88, !7, i64 232, !6, i64 344, !18, i64 352}
!15 = !{!"short", !7, i64 0}
!16 = !{!"_ZTS13ma_node_state", !7, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTS23ma_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTS22ma_mono_expansion_mode", !7, i64 0}
!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, !17, i64 800, !18, i64 808, !7, i64 812, !6, i64 816}
!24 = !{!"_ZTS14ma_engine_node", !14, i64 0, !6, i64 360, !18, i64 368, !25, i64 376, !29, i64 416, !33, i64 552, !40, i64 736, !28, i64 752, !28, i64 756, !28, i64 760, !18, i64 764, !18, i64 768, !18, i64 772, !7, i64 776, !6, i64 784}
!25 = !{!"_ZTS8ma_fader", !26, i64 0, !28, i64 12, !28, i64 16, !17, i64 24, !17, i64 32}
!26 = !{!"_ZTS15ma_fader_config", !27, i64 0, !18, i64 4, !18, i64 8}
!27 = !{!"_ZTS9ma_format", !7, i64 0}
!28 = !{!"float", !7, i64 0}
!29 = !{!"_ZTS19ma_linear_resampler", !30, i64 0, !18, i64 32, !18, i64 36, !18, i64 40, !18, i64 44, !7, i64 48, !7, i64 56, !32, i64 64, !6, i64 120, !18, i64 128}
!30 = !{!"_ZTS26ma_linear_resampler_config", !27, i64 0, !18, i64 4, !18, i64 8, !18, i64 12, !18, i64 16, !31, i64 24}
!31 = !{!"double", !7, i64 0}
!32 = !{!"_ZTS6ma_lpf", !27, i64 0, !18, i64 4, !18, i64 8, !18, i64 12, !18, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !18, i64 48}
!33 = !{!"_ZTS14ma_spatializer", !18, i64 0, !18, 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, !18, i64 68, !37, i64 72, !37, i64 84, !37, i64 96, !28, i64 108, !38, i64 112, !6, i64 160, !6, i64 168, !18, 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, !18, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !18, i64 40}
!39 = !{!"_ZTS16ma_gainer_config", !18, i64 0, !18, i64 4}
!40 = !{!"_ZTS9ma_panner", !27, i64 0, !18, i64 4, !41, i64 8, !28, i64 12}
!41 = !{!"_ZTS11ma_pan_mode", !7, i64 0}
!42 = !{!22, !6, i64 832}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass