; 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_context_config = type { ptr, i32, i64, ptr, %struct.ma_allocation_callbacks, %struct.anon.37, %struct.anon.38, %struct.anon.39, %struct.anon.40, %struct.ma_backend_callbacks }
%struct.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.anon.37 = type { i32 }
%struct.anon.38 = type { ptr, ptr, i32 }
%struct.anon.39 = type { i32, i32, i32, i32 }
%struct.anon.40 = type { ptr, i32 }
%struct.ma_backend_callbacks = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ma_context = type { %struct.ma_backend_callbacks, i32, ptr, %struct.ma_log, i32, i64, ptr, %struct.ma_allocation_callbacks, %union.pthread_mutex_t, %union.pthread_mutex_t, i32, i32, i32, ptr, %union.anon.41, %union.anon.46 }
%struct.ma_log = type { [4 x %struct.ma_log_callback], i32, %struct.ma_allocation_callbacks, %union.pthread_mutex_t }
%struct.ma_log_callback = type { ptr, ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.anon.41 = type { %struct.anon.42 }
%struct.anon.42 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %union.pthread_mutex_t, i32 }
%union.anon.46 = type { %struct.anon.47 }
%struct.anon.47 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.6 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__.ma_context_init = external hidden unnamed_addr constant [98 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [34 x i8], align 1

; 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: mustprogress uwtable
declare dso_local i32 @ma_log_init(ptr noundef, ptr noundef) #2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ma_context_get_log(ptr noundef) #5

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

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

21:                                               ; preds = %4
  store i32 -2, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %247

22:                                               ; preds = %4
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %23, i8 0, i64 1136, i1 false)
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 232, ptr %17) #7
  call void @ma_context_config_init(ptr dead_on_unwind writable sret(%struct.ma_context_config) align 8 %17)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %17, i64 232, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 232, ptr %17) #7
  store ptr %11, ptr %8, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %26, %22
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ma_context, ptr %28, i32 0, i32 7
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ma_context_config, ptr %30, i32 0, i32 4
  %32 = call noundef i32 @_ZL33ma_allocation_callbacks_init_copyP23ma_allocation_callbacksPKS_(ptr noundef %29, ptr noundef %31)
  store i32 %32, ptr %10, align 4, !tbaa !18
  %33 = load i32, ptr %10, align 4, !tbaa !18
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %27
  %36 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %36, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %247

37:                                               ; preds = %27
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ma_context_config, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !20
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %48

42:                                               ; preds = %37
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.ma_context_config, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !20
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ma_context, ptr %46, i32 0, i32 2
  store ptr %45, ptr %47, align 8, !tbaa !28
  br label %65

48:                                               ; preds = %37
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ma_context, ptr %49, i32 0, i32 7
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ma_context, ptr %51, i32 0, i32 3
  %53 = call i32 @ma_log_init(ptr noundef %50, ptr noundef %52)
  store i32 %53, ptr %10, align 4, !tbaa !18
  %54 = load i32, ptr %10, align 4, !tbaa !18
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %61

56:                                               ; preds = %48
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.ma_context, ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ma_context, ptr %59, i32 0, i32 2
  store ptr %58, ptr %60, align 8, !tbaa !28
  br label %64

61:                                               ; preds = %48
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ma_context, ptr %62, i32 0, i32 2
  store ptr null, ptr %63, align 8, !tbaa !28
  br label %64

64:                                               ; preds = %61, %56
  br label %65

65:                                               ; preds = %64, %42
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ma_context_config, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 8, !tbaa !32
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ma_context, ptr %69, i32 0, i32 4
  store i32 %68, ptr %70, align 8, !tbaa !33
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ma_context_config, ptr %71, i32 0, i32 2
  %73 = load i64, ptr %72, align 8, !tbaa !34
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.ma_context, ptr %74, i32 0, i32 5
  store i64 %73, ptr %75, align 8, !tbaa !35
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ma_context_config, ptr %76, i32 0, i32 3
  %78 = load ptr, ptr %77, align 8, !tbaa !36
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ma_context, ptr %79, i32 0, i32 6
  store ptr %78, ptr %80, align 8, !tbaa !37
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = call noundef i32 @_ZL28ma_context_init_backend_apisP10ma_context(ptr noundef %81)
  store i32 %82, ptr %10, align 4, !tbaa !18
  %83 = load i32, ptr %10, align 4, !tbaa !18
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %87

85:                                               ; preds = %65
  %86 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %86, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %247

87:                                               ; preds = %65
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %96, %87
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = icmp ule i32 %89, 14
  br i1 %90, label %91, label %99

91:                                               ; preds = %88
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = load i32, ptr %13, align 4, !tbaa !9
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds [15 x i32], ptr %12, i64 0, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !38
  br label %96

96:                                               ; preds = %91
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = add i32 %97, 1
  store i32 %98, ptr %13, align 4, !tbaa !9
  br label %88, !llvm.loop !39

99:                                               ; preds = %88
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %100, ptr %14, align 8, !tbaa !5
  %101 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %101, ptr %15, align 4, !tbaa !9
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %106

104:                                              ; preds = %99
  %105 = getelementptr inbounds [15 x i32], ptr %12, i64 0, i64 0
  store ptr %105, ptr %14, align 8, !tbaa !5
  store i32 15, ptr %15, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %104, %99
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  br label %112

110:                                              ; preds = %106
  call void @__assert_fail(ptr noundef @.str.34, ptr noundef @.str.6, i32 noundef 39432, ptr noundef @__PRETTY_FUNCTION__.ma_context_init) #8
  unreachable

111:                                              ; No predecessors!
  br label %112

112:                                              ; preds = %111, %109
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %242, %112
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = load i32, ptr %15, align 4, !tbaa !9
  %116 = icmp ult i32 %114, %115
  br i1 %116, label %117, label %245

117:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %118 = load ptr, ptr %14, align 8, !tbaa !5
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !38
  store i32 %122, ptr %18, align 4, !tbaa !38
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.ma_context, ptr %123, i32 0, i32 0
  call void @llvm.memset.p0.i64(ptr align 8 %124, i8 0, i64 104, i1 false)
  %125 = load i32, ptr %18, align 4, !tbaa !38
  switch i32 %125, label %147 [
    i32 7, label %126
    i32 8, label %130
    i32 9, label %134
    i32 13, label %138
    i32 14, label %143
  ]

126:                                              ; preds = %117
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.ma_context, ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds %struct.ma_backend_callbacks, ptr %128, i32 0, i32 0
  store ptr @_ZL22ma_context_init__pulseP10ma_contextPK17ma_context_configP20ma_backend_callbacks, ptr %129, align 8, !tbaa !41
  br label %148

130:                                              ; preds = %117
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.ma_context, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds %struct.ma_backend_callbacks, ptr %132, i32 0, i32 0
  store ptr @_ZL21ma_context_init__alsaP10ma_contextPK17ma_context_configP20ma_backend_callbacks, ptr %133, align 8, !tbaa !41
  br label %148

134:                                              ; preds = %117
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ma_context, ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds %struct.ma_backend_callbacks, ptr %136, i32 0, i32 0
  store ptr @_ZL21ma_context_init__jackP10ma_contextPK17ma_context_configP20ma_backend_callbacks, ptr %137, align 8, !tbaa !41
  br label %148

138:                                              ; preds = %117
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ma_context_config, ptr %139, i32 0, i32 9
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.ma_context, ptr %141, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %142, ptr align 8 %140, i64 104, i1 false), !tbaa.struct !42
  br label %148

143:                                              ; preds = %117
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.ma_context, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.ma_backend_callbacks, ptr %145, i32 0, i32 0
  store ptr @_ZL21ma_context_init__nullP10ma_contextPK17ma_context_configP20ma_backend_callbacks, ptr %146, align 8, !tbaa !41
  br label %148

147:                                              ; preds = %117
  br label %148

148:                                              ; preds = %147, %143, %138, %134, %130, %126
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.ma_context, ptr %149, i32 0, i32 0
  %151 = getelementptr inbounds %struct.ma_backend_callbacks, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !41
  %153 = icmp ne ptr %152, null
  br i1 %153, label %154, label %169

154:                                              ; preds = %148
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = call ptr @ma_context_get_log(ptr noundef %155)
  %157 = load i32, ptr %18, align 4, !tbaa !38
  %158 = call ptr @ma_get_backend_name(i32 noundef %157)
  %159 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %156, i32 noundef 4, ptr noundef @.str.35, ptr noundef %158)
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.ma_context, ptr %160, i32 0, i32 0
  %162 = getelementptr inbounds %struct.ma_backend_callbacks, ptr %161, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !41
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.ma_context, ptr %166, i32 0, i32 0
  %168 = call noundef i32 %163(ptr noundef %164, ptr noundef %165, ptr noundef %167)
  store i32 %168, ptr %10, align 4, !tbaa !18
  br label %170

169:                                              ; preds = %148
  store i32 -103, ptr %10, align 4, !tbaa !18
  br label %170

170:                                              ; preds = %169, %154
  %171 = load i32, ptr %10, align 4, !tbaa !18
  %172 = icmp eq i32 %171, 0
  br i1 %172, label %173, label %232

173:                                              ; preds = %170
  %174 = load ptr, ptr %9, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.ma_context, ptr %174, i32 0, i32 8
  %176 = call i32 @ma_mutex_init(ptr noundef %175)
  store i32 %176, ptr %10, align 4, !tbaa !18
  %177 = load i32, ptr %10, align 4, !tbaa !18
  %178 = icmp ne i32 %177, 0
  br i1 %178, label %179, label %183

179:                                              ; preds = %173
  %180 = load ptr, ptr %9, align 8, !tbaa !5
  %181 = call ptr @ma_context_get_log(ptr noundef %180)
  %182 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %181, i32 noundef 2, ptr noundef @.str.36)
  br label %183

183:                                              ; preds = %179, %173
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.ma_context, ptr %184, i32 0, i32 9
  %186 = call i32 @ma_mutex_init(ptr noundef %185)
  store i32 %186, ptr %10, align 4, !tbaa !18
  %187 = load i32, ptr %10, align 4, !tbaa !18
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %193

189:                                              ; preds = %183
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  %191 = call ptr @ma_context_get_log(ptr noundef %190)
  %192 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %191, i32 noundef 2, ptr noundef @.str.37)
  br label %193

193:                                              ; preds = %189, %183
  %194 = load ptr, ptr %9, align 8, !tbaa !5
  %195 = call ptr @ma_context_get_log(ptr noundef %194)
  %196 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %195, i32 noundef 4, ptr noundef @.str.38)
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = call ptr @ma_context_get_log(ptr noundef %197)
  %199 = call noundef i32 @_ZL19ma_is_little_endianv()
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %201, label %202

201:                                              ; preds = %193
  br label %203

202:                                              ; preds = %193
  br label %203

203:                                              ; preds = %202, %201
  %204 = phi ptr [ @.str.40, %201 ], [ @.str.41, %202 ]
  %205 = getelementptr inbounds [3 x i8], ptr %204, i64 0, i64 0
  %206 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %198, i32 noundef 4, ptr noundef @.str.39, ptr noundef %205)
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = call ptr @ma_context_get_log(ptr noundef %207)
  %209 = call noundef i32 @_ZL11ma_has_sse2v()
  %210 = icmp ne i32 %209, 0
  %211 = zext i1 %210 to i64
  %212 = select i1 %210, ptr @.str.43, ptr @.str.44
  %213 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %208, i32 noundef 4, ptr noundef @.str.42, ptr noundef %212)
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = call ptr @ma_context_get_log(ptr noundef %214)
  %216 = call noundef i32 @_ZL11ma_has_avx2v()
  %217 = icmp ne i32 %216, 0
  %218 = zext i1 %217 to i64
  %219 = select i1 %217, ptr @.str.43, ptr @.str.44
  %220 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %215, i32 noundef 4, ptr noundef @.str.45, ptr noundef %219)
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = call ptr @ma_context_get_log(ptr noundef %221)
  %223 = call noundef i32 @_ZL11ma_has_neonv()
  %224 = icmp ne i32 %223, 0
  %225 = zext i1 %224 to i64
  %226 = select i1 %224, ptr @.str.43, ptr @.str.44
  %227 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %222, i32 noundef 4, ptr noundef @.str.46, ptr noundef %226)
  %228 = load i32, ptr %18, align 4, !tbaa !38
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.ma_context, ptr %229, i32 0, i32 1
  store i32 %228, ptr %230, align 8, !tbaa !43
  %231 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %231, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %239

232:                                              ; preds = %170
  %233 = load ptr, ptr %9, align 8, !tbaa !5
  %234 = call ptr @ma_context_get_log(ptr noundef %233)
  %235 = load i32, ptr %18, align 4, !tbaa !38
  %236 = call ptr @ma_get_backend_name(i32 noundef %235)
  %237 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %234, i32 noundef 4, ptr noundef @.str.47, ptr noundef %236)
  br label %238

238:                                              ; preds = %232
  store i32 0, ptr %16, align 4
  br label %239

239:                                              ; preds = %238, %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  %240 = load i32, ptr %16, align 4
  switch i32 %240, label %247 [
    i32 0, label %241
  ]

241:                                              ; preds = %239
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %13, align 4, !tbaa !9
  %244 = add i32 %243, 1
  store i32 %244, ptr %13, align 4, !tbaa !9
  br label %113, !llvm.loop !44

245:                                              ; preds = %113
  %246 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %246, i8 0, i64 1136, i1 false)
  store i32 -103, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %247

247:                                              ; preds = %245, %239, %85, %35, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 60, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 232, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %248 = load i32, ptr %5, align 4
  ret i32 %248
}

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

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

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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL19ma_is_little_endianv() #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11ma_has_sse2v() #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11ma_has_avx2v() #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11ma_has_neonv() #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { noreturn nounwind "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"="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 #6 = { alwaysinline 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{i64 0, i64 8, !5, i64 8, i64 4, !12, i64 16, i64 8, !14, i64 24, i64 8, !5, i64 32, i64 8, !5, i64 40, i64 8, !5, i64 48, i64 8, !5, i64 56, i64 8, !5, i64 64, i64 4, !9, i64 72, i64 8, !5, i64 80, i64 8, !5, i64 88, i64 4, !9, i64 96, i64 4, !16, i64 100, i64 4, !9, i64 104, i64 4, !9, i64 108, i64 4, !9, i64 112, i64 8, !5, i64 120, i64 4, !9, i64 128, i64 8, !5, i64 136, i64 8, !5, i64 144, i64 8, !5, i64 152, i64 8, !5, i64 160, i64 8, !5, i64 168, i64 8, !5, i64 176, i64 8, !5, i64 184, i64 8, !5, i64 192, i64 8, !5, i64 200, i64 8, !5, i64 208, i64 8, !5, i64 216, i64 8, !5, i64 224, i64 8, !5}
!12 = !{!13, !13, i64 0}
!13 = !{!"_ZTS18ma_thread_priority", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTS23ma_ios_session_category", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTS9ma_result", !7, i64 0}
!20 = !{!21, !6, i64 0}
!21 = !{!"_ZTS17ma_context_config", !6, i64 0, !13, i64 8, !15, i64 16, !6, i64 24, !22, i64 32, !23, i64 64, !24, i64 72, !25, i64 96, !26, i64 112, !27, i64 128}
!22 = !{!"_ZTS23ma_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!"_ZTSN17ma_context_configUt_E", !10, i64 0}
!24 = !{!"_ZTSN17ma_context_configUt0_E", !6, i64 0, !6, i64 8, !10, i64 16}
!25 = !{!"_ZTSN17ma_context_configUt1_E", !17, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!26 = !{!"_ZTSN17ma_context_configUt2_E", !6, i64 0, !10, i64 8}
!27 = !{!"_ZTS20ma_backend_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!28 = !{!29, !6, i64 112}
!29 = !{!"_ZTS10ma_context", !27, i64 0, !30, i64 104, !6, i64 112, !31, i64 120, !13, i64 264, !15, i64 272, !6, i64 280, !22, i64 288, !7, i64 320, !7, i64 360, !10, i64 400, !10, i64 404, !10, i64 408, !6, i64 416, !7, i64 424, !7, i64 1008}
!30 = !{!"_ZTS10ma_backend", !7, i64 0}
!31 = !{!"_ZTS6ma_log", !7, i64 0, !10, i64 64, !22, i64 72, !7, i64 104}
!32 = !{!21, !13, i64 8}
!33 = !{!29, !13, i64 264}
!34 = !{!21, !15, i64 16}
!35 = !{!29, !15, i64 272}
!36 = !{!21, !6, i64 24}
!37 = !{!29, !6, i64 280}
!38 = !{!30, !30, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!29, !6, i64 0}
!42 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 8, !5, i64 40, i64 8, !5, i64 48, i64 8, !5, i64 56, i64 8, !5, i64 64, i64 8, !5, i64 72, i64 8, !5, i64 80, i64 8, !5, i64 88, i64 8, !5, i64 96, i64 8, !5}
!43 = !{!29, !30, i64 104}
!44 = distinct !{!44, !40}


; 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_context_config = type { ptr, i32, i64, ptr, %struct.ma_allocation_callbacks, %struct.anon.37, %struct.anon.38, %struct.anon.39, %struct.anon.40, %struct.ma_backend_callbacks }
%struct.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.anon.37 = type { i32 }
%struct.anon.38 = type { ptr, ptr, i32 }
%struct.anon.39 = type { i32, i32, i32, i32 }
%struct.anon.40 = type { ptr, i32 }
%struct.ma_backend_callbacks = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.35 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [34 x i8], align 1

; 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 i32 @ma_log_init(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ma_context_get_log(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_context_init(ptr noundef readonly %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca %struct.ma_context_config, align 8
  %6 = alloca [15 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 232, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %6) #6
  %7 = icmp eq ptr %3, null
  br i1 %7, label %83, label %8

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

10:                                               ; preds = %8
  call void @ma_context_config_init(ptr dead_on_unwind nonnull writable sret(%struct.ma_context_config) align 8 %5)
  br label %11

11:                                               ; preds = %10, %8
  %.078 = phi ptr [ %5, %10 ], [ %2, %8 ]
  %.078.sroa.phi170 = getelementptr inbounds i8, ptr %.078, i64 128
  %.078.sroa.phi = getelementptr inbounds i8, ptr %.078, i64 24
  %.078.sroa.phi165 = getelementptr inbounds i8, ptr %.078, i64 16
  %.078.sroa.phi162 = getelementptr inbounds i8, ptr %.078, i64 8
  %.078.sroa.phi160 = getelementptr inbounds i8, ptr %.078, i64 32
  %12 = getelementptr inbounds i8, ptr %3, i64 288
  %13 = call noundef i32 @_ZL33ma_allocation_callbacks_init_copyP23ma_allocation_callbacksPKS_(ptr noundef nonnull %12, ptr noundef nonnull %.078.sroa.phi160)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %83

14:                                               ; preds = %11
  %15 = load ptr, ptr %.078, align 8, !tbaa !5
  %.not103 = icmp eq ptr %15, null
  br i1 %.not103, label %18, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %3, i64 112
  store ptr %15, ptr %17, align 8, !tbaa !20
  br label %25

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %3, i64 120
  %20 = call i32 @ma_log_init(ptr noundef nonnull %12, ptr noundef nonnull %19)
  %21 = icmp eq i32 %20, 0
  %22 = getelementptr inbounds i8, ptr %3, i64 112
  br i1 %21, label %23, label %24

23:                                               ; preds = %18
  store ptr %19, ptr %22, align 8, !tbaa !20
  br label %25

24:                                               ; preds = %18
  store ptr null, ptr %22, align 8, !tbaa !20
  br label %25

25:                                               ; preds = %23, %24, %16
  %26 = load i32, ptr %.078.sroa.phi162, align 8, !tbaa !24
  %27 = getelementptr inbounds i8, ptr %3, i64 264
  store i32 %26, ptr %27, align 8, !tbaa !25
  %28 = load i64, ptr %.078.sroa.phi165, align 8, !tbaa !26
  %29 = getelementptr inbounds i8, ptr %3, i64 272
  store i64 %28, ptr %29, align 8, !tbaa !27
  %30 = load ptr, ptr %.078.sroa.phi, align 8, !tbaa !28
  %31 = getelementptr inbounds i8, ptr %3, i64 280
  store ptr %30, ptr %31, align 8, !tbaa !29
  %32 = call noundef i32 @_ZL28ma_context_init_backend_apisP10ma_context(ptr noundef nonnull %3)
  %.not104 = icmp eq i32 %32, 0
  br i1 %.not104, label %.preheader.preheader, label %83

.preheader.preheader:                             ; preds = %25
  store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, ptr %6, align 16, !tbaa !30
  %33 = getelementptr inbounds i8, ptr %6, i64 16
  store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, ptr %33, align 16, !tbaa !30
  %34 = getelementptr inbounds i8, ptr %6, i64 32
  store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, ptr %34, align 16, !tbaa !30
  %35 = getelementptr inbounds i8, ptr %6, i64 48
  store i32 12, ptr %35, align 16, !tbaa !30
  %36 = getelementptr inbounds i8, ptr %6, i64 52
  store i32 13, ptr %36, align 4, !tbaa !30
  %37 = getelementptr inbounds i8, ptr %6, i64 56
  store i32 14, ptr %37, align 8, !tbaa !30
  %38 = icmp eq ptr %0, null
  %spec.select = select i1 %38, ptr %6, ptr %0
  %spec.select113 = select i1 %38, i32 15, i32 %1
  %.not138 = icmp eq i32 %spec.select113, 0
  br i1 %.not138, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader.preheader
  %wide.trip.count = zext i32 %spec.select113 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.thread128
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.thread128 ]
  %39 = getelementptr inbounds i32, ptr %spec.select, i64 %indvars.iv
  %40 = load i32, ptr %39, align 4, !tbaa !30
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %3, i8 0, i64 104, i1 false)
  switch i32 %40, label %.thread128 [
    i32 7, label %.thread.sink.split
    i32 8, label %41
    i32 9, label %42
    i32 13, label %44
    i32 14, label %43
  ]

41:                                               ; preds = %.lr.ph
  br label %.thread.sink.split

42:                                               ; preds = %.lr.ph
  br label %.thread.sink.split

43:                                               ; preds = %.lr.ph
  br label %.thread.sink.split

44:                                               ; preds = %.lr.ph
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %3, ptr noundef nonnull align 8 dereferenceable(104) %.078.sroa.phi170, i64 104, i1 false), !tbaa.struct !31
  %.pr = load ptr, ptr %3, align 8, !tbaa !33
  %.not105 = icmp eq ptr %.pr, null
  br i1 %.not105, label %.thread128, label %.thread

.thread.sink.split:                               ; preds = %.lr.ph, %43, %42, %41
  %_ZL22ma_context_init__pulseP10ma_contextPK17ma_context_configP20ma_backend_callbacks.sink = phi ptr [ @_ZL21ma_context_init__alsaP10ma_contextPK17ma_context_configP20ma_backend_callbacks, %41 ], [ @_ZL21ma_context_init__jackP10ma_contextPK17ma_context_configP20ma_backend_callbacks, %42 ], [ @_ZL21ma_context_init__nullP10ma_contextPK17ma_context_configP20ma_backend_callbacks, %43 ], [ @_ZL22ma_context_init__pulseP10ma_contextPK17ma_context_configP20ma_backend_callbacks, %.lr.ph ]
  store ptr %_ZL22ma_context_init__pulseP10ma_contextPK17ma_context_configP20ma_backend_callbacks.sink, ptr %3, align 8, !tbaa !33
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %44
  %45 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %46 = call ptr @ma_get_backend_name(i32 noundef %40)
  %47 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %45, i32 noundef 4, ptr noundef nonnull @.str.35, ptr noundef %46)
  %48 = load ptr, ptr %3, align 8, !tbaa !33
  %49 = call noundef i32 %48(ptr noundef nonnull %3, ptr noundef nonnull %.078, ptr noundef nonnull %3)
  %.not112 = icmp eq i32 %49, 0
  br i1 %.not112, label %50, label %.thread128

50:                                               ; preds = %.thread
  %51 = getelementptr inbounds i8, ptr %3, i64 320
  %52 = call i32 @ma_mutex_init(ptr noundef nonnull %51)
  %.not106 = icmp eq i32 %52, 0
  br i1 %.not106, label %56, label %53

53:                                               ; preds = %50
  %54 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %55 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %54, i32 noundef 2, ptr noundef nonnull @.str.36)
  br label %56

56:                                               ; preds = %53, %50
  %57 = getelementptr inbounds i8, ptr %3, i64 360
  %58 = call i32 @ma_mutex_init(ptr noundef nonnull %57)
  %.not107 = icmp eq i32 %58, 0
  br i1 %.not107, label %.thread133, label %59

59:                                               ; preds = %56
  %60 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %61 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %60, i32 noundef 2, ptr noundef nonnull @.str.37)
  br label %.thread133

.thread133:                                       ; preds = %56, %59
  %62 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %63 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %62, i32 noundef 4, ptr noundef nonnull @.str.38)
  %64 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %65 = call noundef i32 @_ZL19ma_is_little_endianv()
  %.not108 = icmp eq i32 %65, 0
  %.str.40..str.41 = select i1 %.not108, ptr @.str.41, ptr @.str.40
  %66 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %64, i32 noundef 4, ptr noundef nonnull @.str.39, ptr noundef nonnull %.str.40..str.41)
  %67 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %68 = call noundef i32 @_ZL11ma_has_sse2v()
  %.not109 = icmp eq i32 %68, 0
  %69 = select i1 %.not109, ptr @.str.44, ptr @.str.43
  %70 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %67, i32 noundef 4, ptr noundef nonnull @.str.42, ptr noundef nonnull %69)
  %71 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %72 = call noundef i32 @_ZL11ma_has_avx2v()
  %.not110 = icmp eq i32 %72, 0
  %73 = select i1 %.not110, ptr @.str.44, ptr @.str.43
  %74 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %71, i32 noundef 4, ptr noundef nonnull @.str.45, ptr noundef nonnull %73)
  %75 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %76 = call noundef i32 @_ZL11ma_has_neonv()
  %.not111 = icmp eq i32 %76, 0
  %77 = select i1 %.not111, ptr @.str.44, ptr @.str.43
  %78 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %75, i32 noundef 4, ptr noundef nonnull @.str.46, ptr noundef nonnull %77)
  %79 = getelementptr inbounds i8, ptr %3, i64 104
  store i32 %40, ptr %79, align 8, !tbaa !34
  br label %83

.thread128:                                       ; preds = %.lr.ph, %44, %.thread
  %80 = call ptr @ma_context_get_log(ptr noundef nonnull %3)
  %81 = call ptr @ma_get_backend_name(i32 noundef %40)
  %82 = call i32 (ptr, i32, ptr, ...) @ma_log_postf(ptr noundef %80, i32 noundef 4, ptr noundef nonnull @.str.47, ptr noundef %81)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !35

._crit_edge:                                      ; preds = %.thread128, %.preheader.preheader
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1136) %3, i8 0, i64 1136, i1 false)
  br label %83

83:                                               ; preds = %.thread133, %25, %11, %4, %._crit_edge
  %.2 = phi i32 [ -103, %._crit_edge ], [ -2, %4 ], [ %13, %11 ], [ %32, %25 ], [ %58, %.thread133 ]
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 232, ptr nonnull %5) #6
  ret i32 %.2
}

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

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

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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL19ma_is_little_endianv() local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11ma_has_sse2v() local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11ma_has_avx2v() local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11ma_has_neonv() local_unnamed_addr #5

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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { alwaysinline 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 #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, !7, i64 0}
!6 = !{!"_ZTS17ma_context_config", !7, i64 0, !10, i64 8, !11, i64 16, !7, i64 24, !12, i64 32, !13, i64 64, !15, i64 72, !16, i64 96, !18, i64 112, !19, i64 128}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS18ma_thread_priority", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_ZTS23ma_allocation_callbacks", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!13 = !{!"_ZTSN17ma_context_configUt_E", !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!"_ZTSN17ma_context_configUt0_E", !7, i64 0, !7, i64 8, !14, i64 16}
!16 = !{!"_ZTSN17ma_context_configUt1_E", !17, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!17 = !{!"_ZTS23ma_ios_session_category", !8, i64 0}
!18 = !{!"_ZTSN17ma_context_configUt2_E", !7, i64 0, !14, i64 8}
!19 = !{!"_ZTS20ma_backend_callbacks", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96}
!20 = !{!21, !7, i64 112}
!21 = !{!"_ZTS10ma_context", !19, i64 0, !22, i64 104, !7, i64 112, !23, i64 120, !10, i64 264, !11, i64 272, !7, i64 280, !12, i64 288, !8, i64 320, !8, i64 360, !14, i64 400, !14, i64 404, !14, i64 408, !7, i64 416, !8, i64 424, !8, i64 1008}
!22 = !{!"_ZTS10ma_backend", !8, i64 0}
!23 = !{!"_ZTS6ma_log", !8, i64 0, !14, i64 64, !12, i64 72, !8, i64 104}
!24 = !{!6, !10, i64 8}
!25 = !{!21, !10, i64 264}
!26 = !{!6, !11, i64 16}
!27 = !{!21, !11, i64 272}
!28 = !{!6, !7, i64 24}
!29 = !{!21, !7, i64 280}
!30 = !{!22, !22, i64 0}
!31 = !{i64 0, i64 8, !32, i64 8, i64 8, !32, i64 16, i64 8, !32, i64 24, i64 8, !32, i64 32, i64 8, !32, i64 40, i64 8, !32, i64 48, i64 8, !32, i64 56, i64 8, !32, i64 64, i64 8, !32, i64 72, i64 8, !32, i64 80, i64 8, !32, i64 88, i64 8, !32, i64 96, i64 8, !32}
!32 = !{!7, !7, i64 0}
!33 = !{!21, !7, i64 0}
!34 = !{!21, !22, i64 104}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass