; 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_decoder_config = type { i32, i32, i32, ptr, i32, i32, %struct.ma_resampler_config, %struct.ma_allocation_callbacks, i32, i32, ptr, i32, ptr }
%struct.ma_resampler_config = type { i32, i32, i32, i32, i32, ptr, ptr, %struct.anon.48 }
%struct.anon.48 = type { i32 }
%struct.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.ma_decoder = type { %struct.ma_data_source_base, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, i32, i32, %struct.ma_data_converter, ptr, i64, i64, i64, %struct.ma_allocation_callbacks, %union.anon.61 }
%struct.ma_data_source_base = type { ptr, i64, i64, i64, i64, ptr, ptr, ptr, i32 }
%struct.ma_data_converter = type { i32, i32, i32, i32, i32, i32, i32, i32, %struct.ma_channel_converter, %struct.ma_resampler, i8, i8, i8, i8, i8, i8, ptr }
%struct.ma_channel_converter = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, %union.anon.27, ptr, i32 }
%union.anon.27 = type { ptr }
%struct.ma_resampler = type { ptr, ptr, ptr, i32, i32, i32, i32, %union.anon.28, ptr, i32 }
%union.anon.28 = type { %struct.ma_linear_resampler }
%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 }
%union.anon.61 = type { %struct.anon.63 }
%struct.anon.63 = type { ptr, i64, i64 }
%struct.anon.62 = type { ptr, ptr }

@.str.149 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.150 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.151 = external hidden unnamed_addr constant [4 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z27ma_decoder_config_init_copyPK17ma_decoder_config(ptr dead_on_unwind noalias writable sret(%struct.ma_decoder_config) align 8, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ma_decoder_init_vfs(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.ma_decoder_config, align 8
  %12 = alloca %struct.ma_decoder_config, align 8
  %13 = 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 ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 144, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 144, ptr %12) #4
  %14 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_Z27ma_decoder_config_init_copyPK17ma_decoder_config(ptr dead_on_unwind writable sret(%struct.ma_decoder_config) align 8 %12, ptr noundef %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %12, i64 144, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 144, ptr %12) #4
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = call noundef i32 @_ZL23ma_decoder__preinit_vfsPvPKcPK17ma_decoder_configP10ma_decoder(ptr noundef %15, ptr noundef %16, ptr noundef %11, ptr noundef %17)
  store i32 %18, ptr %10, align 4, !tbaa !22
  %19 = load i32, ptr %10, align 4, !tbaa !22
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %23

21:                                               ; preds = %4
  %22 = load i32, ptr %10, align 4, !tbaa !22
  store i32 %22, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %159

23:                                               ; preds = %4
  store i32 -103, ptr %10, align 4, !tbaa !22
  %24 = getelementptr inbounds %struct.ma_decoder_config, ptr %11, i32 0, i32 8
  %25 = load i32, ptr %24, align 8, !tbaa !24
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %62

27:                                               ; preds = %23
  %28 = getelementptr inbounds %struct.ma_decoder_config, ptr %11, i32 0, i32 8
  %29 = load i32, ptr %28, align 8, !tbaa !24
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %34

31:                                               ; preds = %27
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = call noundef i32 @_ZL29ma_decoder_init_wav__internalPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %32)
  store i32 %33, ptr %10, align 4, !tbaa !22
  br label %34

34:                                               ; preds = %31, %27
  %35 = getelementptr inbounds %struct.ma_decoder_config, ptr %11, i32 0, i32 8
  %36 = load i32, ptr %35, align 8, !tbaa !24
  %37 = icmp eq i32 %36, 2
  br i1 %37, label %38, label %41

38:                                               ; preds = %34
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = call noundef i32 @_ZL30ma_decoder_init_flac__internalPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %39)
  store i32 %40, ptr %10, align 4, !tbaa !22
  br label %41

41:                                               ; preds = %38, %34
  %42 = getelementptr inbounds %struct.ma_decoder_config, ptr %11, i32 0, i32 8
  %43 = load i32, ptr %42, align 8, !tbaa !24
  %44 = icmp eq i32 %43, 3
  br i1 %44, label %45, label %48

45:                                               ; preds = %41
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = call noundef i32 @_ZL29ma_decoder_init_mp3__internalPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %46)
  store i32 %47, ptr %10, align 4, !tbaa !22
  br label %48

48:                                               ; preds = %45, %41
  %49 = getelementptr inbounds %struct.ma_decoder_config, ptr %11, i32 0, i32 8
  %50 = load i32, ptr %49, align 8, !tbaa !24
  %51 = icmp eq i32 %50, 4
  br i1 %51, label %52, label %55

52:                                               ; preds = %48
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = call noundef i32 @_ZL32ma_decoder_init_vorbis__internalPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %53)
  store i32 %54, ptr %10, align 4, !tbaa !22
  br label %55

55:                                               ; preds = %52, %48
  %56 = load i32, ptr %10, align 4, !tbaa !22
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %61

58:                                               ; preds = %55
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %59, i64 noundef 0, i32 noundef 0)
  br label %61

61:                                               ; preds = %58, %55
  br label %62

62:                                               ; preds = %61, %23
  %63 = load i32, ptr %10, align 4, !tbaa !22
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %131

65:                                               ; preds = %62
  %66 = load i32, ptr %10, align 4, !tbaa !22
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %77

68:                                               ; preds = %65
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = call noundef i32 @_ZL32ma_decoder_init_custom__internalPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %69)
  store i32 %70, ptr %10, align 4, !tbaa !22
  %71 = load i32, ptr %10, align 4, !tbaa !22
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %76

73:                                               ; preds = %68
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %74, i64 noundef 0, i32 noundef 0)
  br label %76

76:                                               ; preds = %73, %68
  br label %77

77:                                               ; preds = %76, %65
  %78 = getelementptr inbounds %struct.ma_decoder_config, ptr %11, i32 0, i32 8
  %79 = load i32, ptr %78, align 8, !tbaa !24
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %77
  store i32 -103, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %159

82:                                               ; preds = %77
  %83 = load i32, ptr %10, align 4, !tbaa !22
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %98

85:                                               ; preds = %82
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = call noundef i32 @_ZL23ma_path_extension_equalPKcS0_(ptr noundef %86, ptr noundef @.str.149)
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %98

89:                                               ; preds = %85
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = call noundef i32 @_ZL29ma_decoder_init_wav__internalPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %90)
  store i32 %91, ptr %10, align 4, !tbaa !22
  %92 = load i32, ptr %10, align 4, !tbaa !22
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %97

94:                                               ; preds = %89
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %95, i64 noundef 0, i32 noundef 0)
  br label %97

97:                                               ; preds = %94, %89
  br label %98

98:                                               ; preds = %97, %85, %82
  %99 = load i32, ptr %10, align 4, !tbaa !22
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %114

101:                                              ; preds = %98
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = call noundef i32 @_ZL23ma_path_extension_equalPKcS0_(ptr noundef %102, ptr noundef @.str.150)
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %114

105:                                              ; preds = %101
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = call noundef i32 @_ZL30ma_decoder_init_flac__internalPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %106)
  store i32 %107, ptr %10, align 4, !tbaa !22
  %108 = load i32, ptr %10, align 4, !tbaa !22
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %113

110:                                              ; preds = %105
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %111, i64 noundef 0, i32 noundef 0)
  br label %113

113:                                              ; preds = %110, %105
  br label %114

114:                                              ; preds = %113, %101, %98
  %115 = load i32, ptr %10, align 4, !tbaa !22
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %130

117:                                              ; preds = %114
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = call noundef i32 @_ZL23ma_path_extension_equalPKcS0_(ptr noundef %118, ptr noundef @.str.151)
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %130

121:                                              ; preds = %117
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = call noundef i32 @_ZL29ma_decoder_init_mp3__internalPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %122)
  store i32 %123, ptr %10, align 4, !tbaa !22
  %124 = load i32, ptr %10, align 4, !tbaa !22
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %129

126:                                              ; preds = %121
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %127, i64 noundef 0, i32 noundef 0)
  br label %129

129:                                              ; preds = %126, %121
  br label %130

130:                                              ; preds = %129, %117, %114
  br label %131

131:                                              ; preds = %130, %62
  %132 = load i32, ptr %10, align 4, !tbaa !22
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %137

134:                                              ; preds = %131
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = call noundef i32 @_ZL25ma_decoder_init__internalPF9ma_resultP10ma_decoderPvmPmEPFS_S1_x14ma_seek_originES2_PK17ma_decoder_configS1_(ptr noundef @_ZL23ma_decoder__on_read_vfsP10ma_decoderPvmPm, ptr noundef @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin, ptr noundef null, ptr noundef %11, ptr noundef %135)
  store i32 %136, ptr %10, align 4, !tbaa !22
  br label %140

137:                                              ; preds = %131
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = call noundef i32 @_ZL20ma_decoder__postinitPK17ma_decoder_configP10ma_decoder(ptr noundef %11, ptr noundef %138)
  store i32 %139, ptr %10, align 4, !tbaa !22
  br label %140

140:                                              ; preds = %137, %134
  %141 = load i32, ptr %10, align 4, !tbaa !22
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %158

143:                                              ; preds = %140
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.ma_decoder, ptr %144, i32 0, i32 18
  %146 = getelementptr inbounds %struct.anon.62, ptr %145, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8, !tbaa !29
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %156

149:                                              ; preds = %143
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.ma_decoder, ptr %151, i32 0, i32 18
  %153 = getelementptr inbounds %struct.anon.62, ptr %152, i32 0, i32 1
  %154 = load ptr, ptr %153, align 8, !tbaa !29
  %155 = call noundef i32 @_Z23ma_vfs_or_default_closePvS_(ptr noundef %150, ptr noundef %154)
  br label %156

156:                                              ; preds = %149, %143
  %157 = load i32, ptr %10, align 4, !tbaa !22
  store i32 %157, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %159

158:                                              ; preds = %140
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %159

159:                                              ; preds = %158, %156, %81, %21
  call void @llvm.lifetime.end.p0(i64 144, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %160 = load i32, ptr %5, align 4
  ret i32 %160
}

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

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

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{i64 0, i64 4, !10, i64 4, i64 4, !12, i64 8, i64 4, !12, i64 16, i64 8, !5, i64 24, i64 4, !14, i64 28, i64 4, !16, i64 32, i64 4, !10, i64 36, i64 4, !12, i64 40, i64 4, !12, i64 44, i64 4, !12, i64 48, i64 4, !18, i64 56, i64 8, !5, i64 64, i64 8, !5, i64 72, i64 4, !12, i64 80, i64 8, !5, i64 88, i64 8, !5, i64 96, i64 8, !5, i64 104, i64 8, !5, i64 112, i64 4, !20, i64 116, i64 4, !12, i64 120, i64 8, !5, i64 128, i64 4, !12, i64 136, i64 8, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"_ZTS9ma_format", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTS19ma_channel_mix_mode", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTS14ma_dither_mode", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTS21ma_resample_algorithm", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"_ZTS18ma_encoding_format", !7, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"_ZTS9ma_result", !7, i64 0}
!24 = !{!25, !21, i64 112}
!25 = !{!"_ZTS17ma_decoder_config", !11, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !15, i64 24, !17, i64 28, !26, i64 32, !28, i64 80, !21, i64 112, !13, i64 116, !6, i64 120, !13, i64 128, !6, i64 136}
!26 = !{!"_ZTS19ma_resampler_config", !11, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !19, i64 16, !6, i64 24, !6, i64 32, !27, i64 40}
!27 = !{!"_ZTSN19ma_resampler_configUt_E", !13, i64 0}
!28 = !{!"_ZTS23ma_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!29 = !{!7, !7, i64 0}


; 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_decoder_config = type { i32, i32, i32, ptr, i32, i32, %struct.ma_resampler_config, %struct.ma_allocation_callbacks, i32, i32, ptr, i32, ptr }
%struct.ma_resampler_config = type { i32, i32, i32, i32, i32, ptr, ptr, %struct.anon.48 }
%struct.anon.48 = type { i32 }
%struct.ma_allocation_callbacks = type { ptr, ptr, ptr, ptr }

@.str.149 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.150 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.151 = external hidden unnamed_addr constant [4 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 uwtable
declare dso_local noundef i32 @_Z23ma_vfs_or_default_closePvS_(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z27ma_decoder_config_init_copyPK17ma_decoder_config(ptr dead_on_unwind noalias writable sret(%struct.ma_decoder_config) align 8, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @ma_decoder_init_vfs(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = alloca %struct.ma_decoder_config, align 8
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %5) #3
  call void @_Z27ma_decoder_config_init_copyPK17ma_decoder_config(ptr dead_on_unwind nonnull writable sret(%struct.ma_decoder_config) align 8 %5, ptr noundef %2)
  %6 = call noundef i32 @_ZL23ma_decoder__preinit_vfsPvPKcPK17ma_decoder_configP10ma_decoder(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %5, ptr noundef %3)
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %7, label %60

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %5, i64 112
  %9 = load i32, ptr %8, align 8, !tbaa !5
  switch i32 %9, label %12 [
    i32 0, label %.critedge
    i32 1, label %10
  ]

10:                                               ; preds = %7
  %11 = call noundef i32 @_ZL29ma_decoder_init_wav__internalPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  %.pr = load i32, ptr %8, align 8, !tbaa !5
  br label %12

12:                                               ; preds = %7, %10
  %13 = phi i32 [ %9, %7 ], [ %.pr, %10 ]
  %.0 = phi i32 [ -103, %7 ], [ %11, %10 ]
  %14 = icmp eq i32 %13, 2
  br i1 %14, label %15, label %17

15:                                               ; preds = %12
  %16 = call noundef i32 @_ZL30ma_decoder_init_flac__internalPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  %.pre = load i32, ptr %8, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %15, %12
  %18 = phi i32 [ %.pre, %15 ], [ %13, %12 ]
  %.1 = phi i32 [ %16, %15 ], [ %.0, %12 ]
  %19 = icmp eq i32 %18, 3
  br i1 %19, label %20, label %22

20:                                               ; preds = %17
  %21 = call noundef i32 @_ZL29ma_decoder_init_mp3__internalPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  %.pr75 = load i32, ptr %8, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %20, %17
  %23 = phi i32 [ %.pr75, %20 ], [ %18, %17 ]
  %.2 = phi i32 [ %21, %20 ], [ %.1, %17 ]
  %24 = icmp eq i32 %23, 4
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = call noundef i32 @_ZL32ma_decoder_init_vorbis__internalPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  br label %27

27:                                               ; preds = %25, %22
  %.3 = phi i32 [ %26, %25 ], [ %.2, %22 ]
  %.not53 = icmp eq i32 %.3, 0
  br i1 %.not53, label %52, label %28

28:                                               ; preds = %27
  %29 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %3, i64 noundef 0, i32 noundef 0)
  br label %.critedge

.critedge:                                        ; preds = %7, %28
  %30 = call noundef i32 @_ZL32ma_decoder_init_custom__internalPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  %.not55 = icmp eq i32 %30, 0
  br i1 %.not55, label %31, label %.thread

31:                                               ; preds = %.critedge
  %32 = load i32, ptr %8, align 8, !tbaa !5
  %.not56 = icmp eq i32 %32, 0
  br i1 %.not56, label %52, label %60

.thread:                                          ; preds = %.critedge
  %33 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %3, i64 noundef 0, i32 noundef 0)
  %34 = load i32, ptr %8, align 8, !tbaa !5
  %.not5676 = icmp eq i32 %34, 0
  br i1 %.not5676, label %35, label %60

35:                                               ; preds = %.thread
  %36 = call noundef i32 @_ZL23ma_path_extension_equalPKcS0_(ptr noundef %1, ptr noundef nonnull @.str.149)
  %.not58 = icmp eq i32 %36, 0
  br i1 %.not58, label %.critedge70, label %37

37:                                               ; preds = %35
  %38 = call noundef i32 @_ZL29ma_decoder_init_wav__internalPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  %.not59 = icmp eq i32 %38, 0
  br i1 %.not59, label %52, label %39

39:                                               ; preds = %37
  %40 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %3, i64 noundef 0, i32 noundef 0)
  br label %.critedge70

.critedge70:                                      ; preds = %35, %39
  %41 = call noundef i32 @_ZL23ma_path_extension_equalPKcS0_(ptr noundef %1, ptr noundef nonnull @.str.150)
  %.not61 = icmp eq i32 %41, 0
  br i1 %.not61, label %.critedge72, label %42

42:                                               ; preds = %.critedge70
  %43 = call noundef i32 @_ZL30ma_decoder_init_flac__internalPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  %.not62 = icmp eq i32 %43, 0
  br i1 %.not62, label %52, label %44

44:                                               ; preds = %42
  %45 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %3, i64 noundef 0, i32 noundef 0)
  br label %.critedge72

.critedge72:                                      ; preds = %.critedge70, %44
  %46 = call noundef i32 @_ZL23ma_path_extension_equalPKcS0_(ptr noundef %1, ptr noundef nonnull @.str.151)
  %.not64 = icmp eq i32 %46, 0
  br i1 %.not64, label %.critedge74, label %47

47:                                               ; preds = %.critedge72
  %48 = call noundef i32 @_ZL29ma_decoder_init_mp3__internalPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  %.not65 = icmp eq i32 %48, 0
  br i1 %.not65, label %52, label %49

49:                                               ; preds = %47
  %50 = call noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef %3, i64 noundef 0, i32 noundef 0)
  br label %.critedge74

.critedge74:                                      ; preds = %.critedge72, %49
  %51 = call noundef i32 @_ZL25ma_decoder_init__internalPF9ma_resultP10ma_decoderPvmPmEPFS_S1_x14ma_seek_originES2_PK17ma_decoder_configS1_(ptr noundef nonnull @_ZL23ma_decoder__on_read_vfsP10ma_decoderPvmPm, ptr noundef nonnull @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin, ptr noundef null, ptr noundef nonnull %5, ptr noundef %3)
  br label %54

52:                                               ; preds = %31, %47, %27, %37, %42
  %53 = call noundef i32 @_ZL20ma_decoder__postinitPK17ma_decoder_configP10ma_decoder(ptr noundef nonnull %5, ptr noundef %3)
  br label %54

54:                                               ; preds = %52, %.critedge74
  %.9 = phi i32 [ %51, %.critedge74 ], [ %53, %52 ]
  %.not67 = icmp eq i32 %.9, 0
  br i1 %.not67, label %60, label %55

55:                                               ; preds = %54
  %56 = getelementptr inbounds i8, ptr %3, i64 536
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %.not68 = icmp eq ptr %57, null
  br i1 %.not68, label %60, label %58

58:                                               ; preds = %55
  %59 = call noundef i32 @_Z23ma_vfs_or_default_closePvS_(ptr noundef %0, ptr noundef nonnull %57)
  br label %60

60:                                               ; preds = %.thread, %54, %55, %58, %31, %4
  %.040 = phi i32 [ %6, %4 ], [ -103, %31 ], [ %.9, %58 ], [ %.9, %55 ], [ 0, %54 ], [ -103, %.thread ]
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %5) #3
  ret i32 %.040
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL23ma_decoder__on_seek_vfsP10ma_decoderx14ma_seek_origin(ptr noundef, i64 noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL23ma_decoder__on_read_vfsP10ma_decoderPvmPm(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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, !18, i64 112}
!6 = !{!"_ZTS17ma_decoder_config", !7, i64 0, !10, i64 4, !10, i64 8, !11, i64 16, !12, i64 24, !13, i64 28, !14, i64 32, !17, i64 80, !18, i64 112, !10, i64 116, !11, i64 120, !10, i64 128, !11, i64 136}
!7 = !{!"_ZTS9ma_format", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTS19ma_channel_mix_mode", !8, i64 0}
!13 = !{!"_ZTS14ma_dither_mode", !8, i64 0}
!14 = !{!"_ZTS19ma_resampler_config", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !15, i64 16, !11, i64 24, !11, i64 32, !16, i64 40}
!15 = !{!"_ZTS21ma_resample_algorithm", !8, i64 0}
!16 = !{!"_ZTSN19ma_resampler_configUt_E", !10, i64 0}
!17 = !{!"_ZTS23ma_allocation_callbacks", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!18 = !{!"_ZTS18ma_encoding_format", !8, i64 0}
!19 = !{!8, !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass