; 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_spatializer_heap_layout = type { i64, i64, i64, i64 }
%struct.ma_gainer_config = type { i32, i32 }
%struct.ma_vec3f = type { float, float, float }
%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_spatializer_config = type { i32, i32, ptr, i32, i32, i32, float, float, float, float, float, float, float, float, float, float, i32 }

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @ma_channel_map_copy_or_default(ptr noundef, i64 noundef, ptr noundef, i32 noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_Z16ma_vec3f_init_3ffff(float noundef, float noundef, float noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_Z12ma_vec3f_neg8ma_vec3f(<2 x float>, float) #5

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_spatializer_init_preallocated(ptr noundef %0, ptr noundef %1, ptr noundef %2) #6 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.ma_spatializer_heap_layout, align 8
  %10 = alloca %struct.ma_gainer_config, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.ma_vec3f, align 4
  %13 = alloca { <2 x float>, float }, align 8
  %14 = alloca %struct.ma_vec3f, align 4
  %15 = alloca { <2 x float>, float }, align 8
  %16 = alloca %struct.ma_vec3f, align 4
  %17 = alloca { <2 x float>, float }, align 8
  %18 = alloca %struct.ma_vec3f, align 4
  %19 = alloca %struct.ma_vec3f, align 4
  %20 = alloca { <2 x float>, float }, align 4
  %21 = alloca { <2 x float>, float }, align 8
  %22 = alloca %struct.ma_gainer_config, align 4
  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) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %3
  store i32 -2, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %199

26:                                               ; preds = %3
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %27, i8 0, i64 184, i1 false)
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  br i1 %29, label %33, label %30

30:                                               ; preds = %26
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %30, %26
  store i32 -2, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %199

34:                                               ; preds = %30
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = call noundef i32 @_ZL30ma_spatializer_get_heap_layoutPK21ma_spatializer_configP26ma_spatializer_heap_layout(ptr noundef %35, ptr noundef %9)
  store i32 %36, ptr %8, align 4, !tbaa !9
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %34
  %40 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %40, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %199

41:                                               ; preds = %34
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.ma_spatializer, ptr %43, i32 0, i32 23
  store ptr %42, ptr %44, align 8, !tbaa !11
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ma_spatializer_heap_layout, ptr %9, i32 0, i32 0
  %47 = load i64, ptr %46, align 8, !tbaa !21
  call void @llvm.memset.p0.i64(ptr align 1 %45, i8 0, i64 %47, i1 false)
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ma_spatializer_config, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !24
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ma_spatializer, ptr %51, i32 0, i32 0
  store i32 %50, ptr %52, align 8, !tbaa !26
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ma_spatializer_config, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !27
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ma_spatializer, ptr %56, i32 0, i32 1
  store i32 %55, ptr %57, align 4, !tbaa !28
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ma_spatializer_config, ptr %58, i32 0, i32 3
  %60 = load i32, ptr %59, align 8, !tbaa !29
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ma_spatializer, ptr %61, i32 0, i32 3
  store i32 %60, ptr %62, align 8, !tbaa !30
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.ma_spatializer_config, ptr %63, i32 0, i32 4
  %65 = load i32, ptr %64, align 4, !tbaa !31
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ma_spatializer, ptr %66, i32 0, i32 4
  store i32 %65, ptr %67, align 4, !tbaa !32
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ma_spatializer_config, ptr %68, i32 0, i32 5
  %70 = load i32, ptr %69, align 8, !tbaa !33
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ma_spatializer, ptr %71, i32 0, i32 5
  store i32 %70, ptr %72, align 8, !tbaa !34
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ma_spatializer_config, ptr %73, i32 0, i32 6
  %75 = load float, ptr %74, align 4, !tbaa !35
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ma_spatializer, ptr %76, i32 0, i32 6
  store float %75, ptr %77, align 4, !tbaa !36
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ma_spatializer_config, ptr %78, i32 0, i32 7
  %80 = load float, ptr %79, align 8, !tbaa !37
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ma_spatializer, ptr %81, i32 0, i32 7
  store float %80, ptr %82, align 8, !tbaa !38
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ma_spatializer_config, ptr %83, i32 0, i32 8
  %85 = load float, ptr %84, align 4, !tbaa !39
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ma_spatializer, ptr %86, i32 0, i32 8
  store float %85, ptr %87, align 4, !tbaa !40
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ma_spatializer_config, ptr %88, i32 0, i32 9
  %90 = load float, ptr %89, align 8, !tbaa !41
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.ma_spatializer, ptr %91, i32 0, i32 9
  store float %90, ptr %92, align 8, !tbaa !42
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ma_spatializer_config, ptr %93, i32 0, i32 10
  %95 = load float, ptr %94, align 4, !tbaa !43
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ma_spatializer, ptr %96, i32 0, i32 10
  store float %95, ptr %97, align 4, !tbaa !44
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ma_spatializer_config, ptr %98, i32 0, i32 11
  %100 = load float, ptr %99, align 8, !tbaa !45
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.ma_spatializer, ptr %101, i32 0, i32 11
  store float %100, ptr %102, align 8, !tbaa !46
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ma_spatializer_config, ptr %103, i32 0, i32 12
  %105 = load float, ptr %104, align 4, !tbaa !47
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ma_spatializer, ptr %106, i32 0, i32 12
  store float %105, ptr %107, align 4, !tbaa !48
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ma_spatializer_config, ptr %108, i32 0, i32 13
  %110 = load float, ptr %109, align 8, !tbaa !49
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ma_spatializer, ptr %111, i32 0, i32 13
  store float %110, ptr %112, align 8, !tbaa !50
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.ma_spatializer_config, ptr %113, i32 0, i32 14
  %115 = load float, ptr %114, align 4, !tbaa !51
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ma_spatializer, ptr %116, i32 0, i32 14
  store float %115, ptr %117, align 4, !tbaa !52
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.ma_spatializer_config, ptr %118, i32 0, i32 15
  %120 = load float, ptr %119, align 8, !tbaa !53
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.ma_spatializer, ptr %121, i32 0, i32 15
  store float %120, ptr %122, align 8, !tbaa !54
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.ma_spatializer_config, ptr %123, i32 0, i32 16
  %125 = load i32, ptr %124, align 4, !tbaa !55
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.ma_spatializer, ptr %126, i32 0, i32 16
  store i32 %125, ptr %127, align 4, !tbaa !56
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #7
  %128 = call { <2 x float>, float } @_Z16ma_vec3f_init_3ffff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  store { <2 x float>, float } %128, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %13, i64 12, i1 false)
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.ma_spatializer, ptr %129, i32 0, i32 17
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %130, ptr align 4 %12, i64 12, i1 false), !tbaa.struct !57
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #7
  %131 = call { <2 x float>, float } @_Z16ma_vec3f_init_3ffff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef -1.000000e+00)
  store { <2 x float>, float } %131, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %15, i64 12, i1 false)
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.ma_spatializer, ptr %132, i32 0, i32 18
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %133, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !57
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  %134 = call { <2 x float>, float } @_Z16ma_vec3f_init_3ffff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  store { <2 x float>, float } %134, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %17, i64 12, i1 false)
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ma_spatializer, ptr %135, i32 0, i32 19
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %136, ptr align 4 %16, i64 12, i1 false), !tbaa.struct !57
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.ma_spatializer, ptr %137, i32 0, i32 20
  store float 1.000000e+00, ptr %138, align 4, !tbaa !59
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ma_spatializer, ptr %139, i32 0, i32 5
  %141 = load i32, ptr %140, align 8, !tbaa !34
  %142 = icmp eq i32 %141, 1
  br i1 %142, label %143, label %153

143:                                              ; preds = %41
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #7
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.ma_spatializer, ptr %144, i32 0, i32 18
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %145, i64 12, i1 false), !tbaa.struct !57
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %19, i64 12, i1 false)
  %146 = getelementptr inbounds { <2 x float>, float }, ptr %20, i32 0, i32 0
  %147 = load <2 x float>, ptr %146, align 4
  %148 = getelementptr inbounds { <2 x float>, float }, ptr %20, i32 0, i32 1
  %149 = load float, ptr %148, align 4
  %150 = call { <2 x float>, float } @_Z12ma_vec3f_neg8ma_vec3f(<2 x float> %147, float %149)
  store { <2 x float>, float } %150, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 8 %21, i64 12, i1 false)
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.ma_spatializer, ptr %151, i32 0, i32 18
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %152, ptr align 4 %18, i64 12, i1 false), !tbaa.struct !57
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #7
  br label %153

153:                                              ; preds = %143, %41
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.ma_spatializer_config, ptr %154, i32 0, i32 2
  %156 = load ptr, ptr %155, align 8, !tbaa !60
  %157 = icmp ne ptr %156, null
  br i1 %157, label %158, label %178

158:                                              ; preds = %153
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.ma_spatializer_heap_layout, ptr %9, i32 0, i32 1
  %161 = load i64, ptr %160, align 8, !tbaa !61
  %162 = getelementptr inbounds i8, ptr %159, i64 %161
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.ma_spatializer, ptr %163, i32 0, i32 2
  store ptr %162, ptr %164, align 8, !tbaa !62
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.ma_spatializer, ptr %165, i32 0, i32 2
  %167 = load ptr, ptr %166, align 8, !tbaa !62
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ma_spatializer, ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 8, !tbaa !26
  %171 = zext i32 %170 to i64
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.ma_spatializer_config, ptr %172, i32 0, i32 2
  %174 = load ptr, ptr %173, align 8, !tbaa !60
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.ma_spatializer, ptr %175, i32 0, i32 0
  %177 = load i32, ptr %176, align 8, !tbaa !26
  call void @ma_channel_map_copy_or_default(ptr noundef %167, i64 noundef %171, ptr noundef %174, i32 noundef %177)
  br label %178

178:                                              ; preds = %158, %153
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.ma_spatializer_heap_layout, ptr %9, i32 0, i32 2
  %181 = load i64, ptr %180, align 8, !tbaa !63
  %182 = getelementptr inbounds i8, ptr %179, i64 %181
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.ma_spatializer, ptr %183, i32 0, i32 22
  store ptr %182, ptr %184, align 8, !tbaa !64
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  %186 = call i64 @_ZL33ma_spatializer_gainer_config_initPK21ma_spatializer_config(ptr noundef %185)
  store i64 %186, ptr %22, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %22, i64 8, i1 false), !tbaa.struct !65
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  %187 = load ptr, ptr %6, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.ma_spatializer_heap_layout, ptr %9, i32 0, i32 3
  %189 = load i64, ptr %188, align 8, !tbaa !67
  %190 = getelementptr inbounds i8, ptr %187, i64 %189
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.ma_spatializer, ptr %191, i32 0, i32 21
  %193 = call i32 @ma_gainer_init_preallocated(ptr noundef %10, ptr noundef %190, ptr noundef %192)
  store i32 %193, ptr %8, align 4, !tbaa !9
  %194 = load i32, ptr %8, align 4, !tbaa !9
  %195 = icmp ne i32 %194, 0
  br i1 %195, label %196, label %198

196:                                              ; preds = %178
  %197 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %197, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %199

198:                                              ; preds = %178
  store i32 0, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %199

199:                                              ; preds = %198, %196, %39, %33, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %200 = load i32, ptr %4, align 4
  ret i32 %200
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 #6 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #7 = { 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, !6, i64 168}
!12 = !{!"_ZTS14ma_spatializer", !13, i64 0, !13, i64 4, !6, i64 8, !14, i64 16, !15, i64 20, !16, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !17, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !17, i64 56, !17, i64 60, !17, i64 64, !13, i64 68, !18, i64 72, !18, i64 84, !18, i64 96, !17, i64 108, !19, i64 112, !6, i64 160, !6, i64 168, !13, i64 176}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS20ma_attenuation_model", !7, i64 0}
!15 = !{!"_ZTS14ma_positioning", !7, i64 0}
!16 = !{!"_ZTS13ma_handedness", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTS8ma_vec3f", !17, i64 0, !17, i64 4, !17, i64 8}
!19 = !{!"_ZTS9ma_gainer", !20, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40}
!20 = !{!"_ZTS16ma_gainer_config", !13, i64 0, !13, i64 4}
!21 = !{!22, !23, i64 0}
!22 = !{!"_ZTS26ma_spatializer_heap_layout", !23, i64 0, !23, i64 8, !23, i64 16, !23, i64 24}
!23 = !{!"long", !7, i64 0}
!24 = !{!25, !13, i64 0}
!25 = !{!"_ZTS21ma_spatializer_config", !13, i64 0, !13, i64 4, !6, i64 8, !14, i64 16, !15, i64 20, !16, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !17, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !17, i64 56, !17, i64 60, !17, i64 64, !13, i64 68}
!26 = !{!12, !13, i64 0}
!27 = !{!25, !13, i64 4}
!28 = !{!12, !13, i64 4}
!29 = !{!25, !14, i64 16}
!30 = !{!12, !14, i64 16}
!31 = !{!25, !15, i64 20}
!32 = !{!12, !15, i64 20}
!33 = !{!25, !16, i64 24}
!34 = !{!12, !16, i64 24}
!35 = !{!25, !17, i64 28}
!36 = !{!12, !17, i64 28}
!37 = !{!25, !17, i64 32}
!38 = !{!12, !17, i64 32}
!39 = !{!25, !17, i64 36}
!40 = !{!12, !17, i64 36}
!41 = !{!25, !17, i64 40}
!42 = !{!12, !17, i64 40}
!43 = !{!25, !17, i64 44}
!44 = !{!12, !17, i64 44}
!45 = !{!25, !17, i64 48}
!46 = !{!12, !17, i64 48}
!47 = !{!25, !17, i64 52}
!48 = !{!12, !17, i64 52}
!49 = !{!25, !17, i64 56}
!50 = !{!12, !17, i64 56}
!51 = !{!25, !17, i64 60}
!52 = !{!12, !17, i64 60}
!53 = !{!25, !17, i64 64}
!54 = !{!12, !17, i64 64}
!55 = !{!25, !13, i64 68}
!56 = !{!12, !13, i64 68}
!57 = !{i64 0, i64 4, !58, i64 4, i64 4, !58, i64 8, i64 4, !58}
!58 = !{!17, !17, i64 0}
!59 = !{!12, !17, i64 108}
!60 = !{!25, !6, i64 8}
!61 = !{!22, !23, i64 8}
!62 = !{!12, !6, i64 8}
!63 = !{!22, !23, i64 16}
!64 = !{!12, !6, i64 160}
!65 = !{i64 0, i64 4, !66, i64 4, i64 4, !66}
!66 = !{!13, !13, i64 0}
!67 = !{!22, !23, 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_spatializer_heap_layout = type { i64, i64, i64, i64 }
%struct.ma_gainer_config = type { i32, i32 }

; 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @ma_channel_map_copy_or_default(ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_Z16ma_vec3f_init_3ffff(float noundef, float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_Z12ma_vec3f_neg8ma_vec3f(<2 x float>, float) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_spatializer_init_preallocated(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #5 {
  %4 = alloca %struct.ma_spatializer_heap_layout, align 8
  %5 = alloca %struct.ma_gainer_config, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %6 = icmp eq ptr %2, null
  br i1 %6, label %66, label %7

7:                                                ; preds = %3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(184) %2, i8 0, i64 184, i1 false)
  %8 = icmp eq ptr %0, null
  %9 = icmp eq ptr %1, null
  %or.cond = or i1 %8, %9
  br i1 %or.cond, label %66, label %10

10:                                               ; preds = %7
  %11 = call noundef i32 @_ZL30ma_spatializer_get_heap_layoutPK21ma_spatializer_configP26ma_spatializer_heap_layout(ptr noundef nonnull %0, ptr noundef nonnull %4)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %66

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %2, i64 168
  store ptr %1, ptr %13, align 8, !tbaa !5
  %14 = load i64, ptr %4, align 8, !tbaa !18
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %1, i8 0, i64 %14, i1 false)
  %15 = load <2 x i32>, ptr %0, align 8, !tbaa !21
  store <2 x i32> %15, ptr %2, align 8, !tbaa !21
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = getelementptr inbounds i8, ptr %2, i64 16
  %18 = load <2 x i32>, ptr %16, align 8, !tbaa !22
  store <2 x i32> %18, ptr %17, align 8, !tbaa !22
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load i32, ptr %19, align 8, !tbaa !23
  %21 = getelementptr inbounds i8, ptr %2, i64 24
  store i32 %20, ptr %21, align 8, !tbaa !25
  %22 = getelementptr inbounds i8, ptr %0, i64 28
  %23 = getelementptr inbounds i8, ptr %2, i64 28
  %24 = load <4 x float>, ptr %22, align 4, !tbaa !26
  store <4 x float> %24, ptr %23, align 4, !tbaa !26
  %25 = getelementptr inbounds i8, ptr %0, i64 44
  %26 = getelementptr inbounds i8, ptr %2, i64 44
  %27 = load <4 x float>, ptr %25, align 4, !tbaa !26
  store <4 x float> %27, ptr %26, align 4, !tbaa !26
  %28 = getelementptr inbounds i8, ptr %0, i64 60
  %29 = getelementptr inbounds i8, ptr %2, i64 60
  %30 = load <2 x float>, ptr %28, align 4, !tbaa !26
  store <2 x float> %30, ptr %29, align 4, !tbaa !26
  %31 = getelementptr inbounds i8, ptr %0, i64 68
  %32 = load i32, ptr %31, align 4, !tbaa !27
  %33 = getelementptr inbounds i8, ptr %2, i64 68
  store i32 %32, ptr %33, align 4, !tbaa !28
  %34 = call { <2 x float>, float } @_Z16ma_vec3f_init_3ffff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %.fca.0.extract20 = extractvalue { <2 x float>, float } %34, 0
  %.fca.1.extract21 = extractvalue { <2 x float>, float } %34, 1
  %35 = getelementptr inbounds i8, ptr %2, i64 72
  store <2 x float> %.fca.0.extract20, ptr %35, align 8
  %.sroa.425.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 80
  store float %.fca.1.extract21, ptr %.sroa.425.0..sroa_idx, align 8, !tbaa !26
  %36 = call { <2 x float>, float } @_Z16ma_vec3f_init_3ffff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef -1.000000e+00)
  %.fca.0.extract14 = extractvalue { <2 x float>, float } %36, 0
  %.fca.1.extract15 = extractvalue { <2 x float>, float } %36, 1
  %37 = getelementptr inbounds i8, ptr %2, i64 84
  store <2 x float> %.fca.0.extract14, ptr %37, align 4
  %.sroa.419.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 92
  store float %.fca.1.extract15, ptr %.sroa.419.0..sroa_idx, align 4, !tbaa !26
  %38 = call { <2 x float>, float } @_Z16ma_vec3f_init_3ffff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %.fca.0.extract8 = extractvalue { <2 x float>, float } %38, 0
  %.fca.1.extract9 = extractvalue { <2 x float>, float } %38, 1
  %39 = getelementptr inbounds i8, ptr %2, i64 96
  store <2 x float> %.fca.0.extract8, ptr %39, align 8
  %.sroa.413.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 104
  store float %.fca.1.extract9, ptr %.sroa.413.0..sroa_idx, align 8, !tbaa !26
  %40 = getelementptr inbounds i8, ptr %2, i64 108
  store float 1.000000e+00, ptr %40, align 4, !tbaa !29
  %41 = load i32, ptr %21, align 8, !tbaa !25
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %45

43:                                               ; preds = %12
  %.sroa.05.0.copyload = load <2 x float>, ptr %37, align 4
  %.sroa.26.0.copyload = load float, ptr %.sroa.419.0..sroa_idx, align 4, !tbaa !26
  %44 = call { <2 x float>, float } @_Z12ma_vec3f_neg8ma_vec3f(<2 x float> %.sroa.05.0.copyload, float %.sroa.26.0.copyload)
  %.fca.0.extract = extractvalue { <2 x float>, float } %44, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %44, 1
  store <2 x float> %.fca.0.extract, ptr %37, align 4
  store float %.fca.1.extract, ptr %.sroa.419.0..sroa_idx, align 4, !tbaa !26
  br label %45

45:                                               ; preds = %43, %12
  %46 = getelementptr inbounds i8, ptr %0, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !30
  %.not93 = icmp eq ptr %47, null
  br i1 %.not93, label %55, label %48

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %4, i64 8
  %50 = load i64, ptr %49, align 8, !tbaa !31
  %51 = getelementptr inbounds i8, ptr %1, i64 %50
  %52 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %51, ptr %52, align 8, !tbaa !32
  %53 = load i32, ptr %2, align 8, !tbaa !33
  %54 = zext i32 %53 to i64
  call void @ma_channel_map_copy_or_default(ptr noundef %51, i64 noundef %54, ptr noundef nonnull %47, i32 noundef %53)
  br label %55

55:                                               ; preds = %48, %45
  %56 = getelementptr inbounds i8, ptr %4, i64 16
  %57 = load i64, ptr %56, align 8, !tbaa !34
  %58 = getelementptr inbounds i8, ptr %1, i64 %57
  %59 = getelementptr inbounds i8, ptr %2, i64 160
  store ptr %58, ptr %59, align 8, !tbaa !35
  %60 = call i64 @_ZL33ma_spatializer_gainer_config_initPK21ma_spatializer_config(ptr noundef nonnull %0)
  store i64 %60, ptr %5, align 8
  %61 = getelementptr inbounds i8, ptr %4, i64 24
  %62 = load i64, ptr %61, align 8, !tbaa !36
  %63 = getelementptr inbounds i8, ptr %1, i64 %62
  %64 = getelementptr inbounds i8, ptr %2, i64 112
  %65 = call i32 @ma_gainer_init_preallocated(ptr noundef nonnull %5, ptr noundef %63, ptr noundef nonnull %64)
  br label %66

66:                                               ; preds = %55, %10, %7, %3
  %.0 = phi i32 [ -2, %3 ], [ -2, %7 ], [ %11, %10 ], [ %65, %55 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  ret i32 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden i64 @_ZL33ma_spatializer_gainer_config_initPK21ma_spatializer_config(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #6 = { 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 168}
!6 = !{!"_ZTS14ma_spatializer", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !12, i64 20, !13, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60, !14, i64 64, !7, i64 68, !15, i64 72, !15, i64 84, !15, i64 96, !14, i64 108, !16, i64 112, !10, i64 160, !10, i64 168, !7, i64 176}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTS20ma_attenuation_model", !8, i64 0}
!12 = !{!"_ZTS14ma_positioning", !8, i64 0}
!13 = !{!"_ZTS13ma_handedness", !8, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = !{!"_ZTS8ma_vec3f", !14, i64 0, !14, i64 4, !14, i64 8}
!16 = !{!"_ZTS9ma_gainer", !17, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40}
!17 = !{!"_ZTS16ma_gainer_config", !7, i64 0, !7, i64 4}
!18 = !{!19, !20, i64 0}
!19 = !{!"_ZTS26ma_spatializer_heap_layout", !20, i64 0, !20, i64 8, !20, i64 16, !20, i64 24}
!20 = !{!"long", !8, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!8, !8, i64 0}
!23 = !{!24, !13, i64 24}
!24 = !{!"_ZTS21ma_spatializer_config", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !12, i64 20, !13, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60, !14, i64 64, !7, i64 68}
!25 = !{!6, !13, i64 24}
!26 = !{!14, !14, i64 0}
!27 = !{!24, !7, i64 68}
!28 = !{!6, !7, i64 68}
!29 = !{!6, !14, i64 108}
!30 = !{!24, !10, i64 8}
!31 = !{!19, !20, i64 8}
!32 = !{!6, !10, i64 8}
!33 = !{!6, !7, i64 0}
!34 = !{!19, !20, i64 16}
!35 = !{!6, !10, i64 160}
!36 = !{!19, !20, i64 24}


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