; LLVM IR from merpheus-dev/LavaEngine :: src/Utils/soloud/src/audiosource/wav (soloud_wavstream)

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

%"class.SoLoud::WavStreamInstance" = type { %"class.SoLoud::AudioSourceInstance", ptr, i32, ptr, %"union.SoLoud::WavStreamInstance::codec", i32, i32, ptr }
%"class.SoLoud::AudioSourceInstance" = type { ptr, i32, i32, i32, float, [8 x float], float, float, float, float, i32, float, float, double, double, %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", i32, [8 x float], i32, i32, [8 x ptr], [2 x ptr], i32, i32, i32, double }
%"class.SoLoud::Fader" = type { float, float, float, double, double, double, float, i32 }
%"union.SoLoud::WavStreamInstance::codec" = type { ptr }
%"class.SoLoud::WavStream" = type <{ %"class.SoLoud::AudioSource", i32, [4 x i8], ptr, ptr, ptr, i32, [4 x i8] }>
%"class.SoLoud::AudioSource" = type { ptr, i32, float, float, i32, i32, float, float, float, i32, float, [8 x ptr], ptr, ptr, ptr, i32, double }

@_ZTVN6SoLoud17WavStreamInstanceE = external dso_local unnamed_addr constant { [9 x ptr] }, align 8

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud17WavStreamInstanceC2EPNS_9WavStreamE(ptr noundef nonnull align 8 dereferenceable(544) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496) %10)
  store ptr getelementptr inbounds inrange(-16, 56) ({ [9 x ptr] }, ptr @_ZTVN6SoLoud17WavStreamInstanceE, i32 0, i32 0, i32 2), ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  store ptr %12, ptr %13, align 8, !tbaa !11
  %14 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 2
  store i32 0, ptr %14, align 8, !tbaa !18
  %15 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  store ptr null, ptr %15, align 8, !tbaa !19
  %16 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  store ptr null, ptr %16, align 8, !tbaa !19
  %17 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr null, ptr %17, align 8, !tbaa !20
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %18, i32 0, i32 4
  %20 = load ptr, ptr %19, align 8, !tbaa !21
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %56

22:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %23 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #7
          to label %24 unwind label %47

24:                                               ; preds = %22
  invoke void @_ZN6SoLoud10MemoryFileC1Ev(ptr noundef nonnull align 8 dereferenceable(25) %23)
          to label %25 unwind label %51

25:                                               ; preds = %24
  store ptr %23, ptr %5, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr %26, ptr %27, align 8, !tbaa !20
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %29, i32 0, i32 4
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %32, i64 8
  %34 = load ptr, ptr %33, align 8
  %35 = invoke noundef ptr %34(ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %36 unwind label %47

36:                                               ; preds = %25
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %37, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !21
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds ptr, ptr %40, i64 4
  %42 = load ptr, ptr %41, align 8
  %43 = invoke noundef i32 %42(ptr noundef nonnull align 8 dereferenceable(8) %39)
          to label %44 unwind label %47

44:                                               ; preds = %36
  %45 = invoke noundef i32 @_ZN6SoLoud10MemoryFile7openMemEPKhjbb(ptr noundef nonnull align 8 dereferenceable(25) %28, ptr noundef %35, i32 noundef %43, i1 noundef zeroext false, i1 noundef zeroext false)
          to label %46 unwind label %47

46:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %105

47:                                               ; preds = %44, %36, %25, %22
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %6, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %7, align 4
  br label %55

51:                                               ; preds = %24
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %6, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %23, i64 noundef 32) #8
  br label %55

55:                                               ; preds = %51, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %296

56:                                               ; preds = %2
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !24
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %82

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %62 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #7
          to label %63 unwind label %73

63:                                               ; preds = %61
  invoke void @_ZN6SoLoud8DiskFileC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %62)
          to label %64 unwind label %77

64:                                               ; preds = %63
  store ptr %62, ptr %8, align 8, !tbaa !5
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr %65, ptr %66, align 8, !tbaa !20
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %68, i32 0, i32 3
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  %71 = invoke noundef i32 @_ZN6SoLoud8DiskFile4openEPKc(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef %70)
          to label %72 unwind label %73

72:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %104

73:                                               ; preds = %64, %61
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %6, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %7, align 4
  br label %81

77:                                               ; preds = %63
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %6, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %62, i64 noundef 16) #8
  br label %81

81:                                               ; preds = %77, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %296

82:                                               ; preds = %56
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %83, i32 0, i32 5
  %85 = load ptr, ptr %84, align 8, !tbaa !25
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %102

87:                                               ; preds = %82
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %88, i32 0, i32 5
  %90 = load ptr, ptr %89, align 8, !tbaa !25
  %91 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr %90, ptr %91, align 8, !tbaa !20
  %92 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %93 = load ptr, ptr %92, align 8, !tbaa !20
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  %95 = getelementptr inbounds ptr, ptr %94, i64 5
  %96 = load ptr, ptr %95, align 8
  invoke void %96(ptr noundef nonnull align 8 dereferenceable(8) %93, i32 noundef 0)
          to label %97 unwind label %98

97:                                               ; preds = %87
  br label %103

98:                                               ; preds = %237, %235, %200, %117, %115, %87
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %6, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %7, align 4
  br label %296

102:                                              ; preds = %82
  br label %295

103:                                              ; preds = %97
  br label %104

104:                                              ; preds = %103, %72
  br label %105

105:                                              ; preds = %104, %46
  %106 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %107 = load ptr, ptr %106, align 8, !tbaa !20
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %295

109:                                              ; preds = %105
  %110 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !11
  %112 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %111, i32 0, i32 1
  %113 = load i32, ptr %112, align 8, !tbaa !26
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %115, label %152

115:                                              ; preds = %109
  %116 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 440) #7
          to label %117 unwind label %98

117:                                              ; preds = %115
  %118 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  store ptr %116, ptr %118, align 8, !tbaa !19
  %119 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !19
  %121 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !20
  %123 = invoke i32 @drwav_init(ptr noundef %120, ptr noundef @_ZN6SoLoud15drwav_read_funcEPvS0_m, ptr noundef @_ZN6SoLoud15drwav_seek_funcEPvi17drwav_seek_origin, ptr noundef %122, ptr noundef null)
          to label %124 unwind label %98

124:                                              ; preds = %117
  %125 = icmp ne i32 %123, 0
  br i1 %125, label %151, label %126

126:                                              ; preds = %124
  %127 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  %128 = load ptr, ptr %127, align 8, !tbaa !19
  %129 = icmp eq ptr %128, null
  br i1 %129, label %131, label %130

130:                                              ; preds = %126
  call void @_ZdlPvm(ptr noundef %128, i64 noundef 440) #8
  br label %131

131:                                              ; preds = %130, %126
  %132 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  store ptr null, ptr %132, align 8, !tbaa !19
  %133 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %134 = load ptr, ptr %133, align 8, !tbaa !20
  %135 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %136 = load ptr, ptr %135, align 8, !tbaa !11
  %137 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %136, i32 0, i32 5
  %138 = load ptr, ptr %137, align 8, !tbaa !25
  %139 = icmp ne ptr %134, %138
  br i1 %139, label %140, label %149

140:                                              ; preds = %131
  %141 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %142 = load ptr, ptr %141, align 8, !tbaa !20
  %143 = icmp eq ptr %142, null
  br i1 %143, label %148, label %144

144:                                              ; preds = %140
  %145 = load ptr, ptr %142, align 8, !tbaa !9
  %146 = getelementptr inbounds ptr, ptr %145, i64 1
  %147 = load ptr, ptr %146, align 8
  call void %147(ptr noundef nonnull align 8 dereferenceable(8) %142) #6
  br label %148

148:                                              ; preds = %144, %140
  br label %149

149:                                              ; preds = %148, %131
  %150 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr null, ptr %150, align 8, !tbaa !20
  br label %151

151:                                              ; preds = %149, %124
  br label %294

152:                                              ; preds = %109
  %153 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %154 = load ptr, ptr %153, align 8, !tbaa !11
  %155 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 8, !tbaa !26
  %157 = icmp eq i32 %156, 1
  br i1 %157, label %158, label %194

158:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %159 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %160 = load ptr, ptr %159, align 8, !tbaa !20
  %161 = invoke ptr @stb_vorbis_open_file(ptr noundef %160, i32 noundef 0, ptr noundef %9, ptr noundef null)
          to label %162 unwind label %184

162:                                              ; preds = %158
  %163 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  store ptr %161, ptr %163, align 8, !tbaa !19
  %164 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  %165 = load ptr, ptr %164, align 8, !tbaa !19
  %166 = icmp ne ptr %165, null
  br i1 %166, label %190, label %167

167:                                              ; preds = %162
  %168 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %169 = load ptr, ptr %168, align 8, !tbaa !20
  %170 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %171 = load ptr, ptr %170, align 8, !tbaa !11
  %172 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %171, i32 0, i32 5
  %173 = load ptr, ptr %172, align 8, !tbaa !25
  %174 = icmp ne ptr %169, %173
  br i1 %174, label %175, label %188

175:                                              ; preds = %167
  %176 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %177 = load ptr, ptr %176, align 8, !tbaa !20
  %178 = icmp eq ptr %177, null
  br i1 %178, label %183, label %179

179:                                              ; preds = %175
  %180 = load ptr, ptr %177, align 8, !tbaa !9
  %181 = getelementptr inbounds ptr, ptr %180, i64 1
  %182 = load ptr, ptr %181, align 8
  call void %182(ptr noundef nonnull align 8 dereferenceable(8) %177) #6
  br label %183

183:                                              ; preds = %179, %175
  br label %188

184:                                              ; preds = %158
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %6, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %296

188:                                              ; preds = %183, %167
  %189 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr null, ptr %189, align 8, !tbaa !20
  br label %190

190:                                              ; preds = %188, %162
  %191 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 5
  store i32 0, ptr %191, align 8, !tbaa !27
  %192 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 6
  store i32 0, ptr %192, align 4, !tbaa !28
  %193 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 7
  store ptr null, ptr %193, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %293

194:                                              ; preds = %152
  %195 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %196 = load ptr, ptr %195, align 8, !tbaa !11
  %197 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %196, i32 0, i32 1
  %198 = load i32, ptr %197, align 8, !tbaa !26
  %199 = icmp eq i32 %198, 2
  br i1 %199, label %200, label %229

200:                                              ; preds = %194
  %201 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %202 = load ptr, ptr %201, align 8, !tbaa !20
  %203 = invoke ptr @drflac_open(ptr noundef @_ZN6SoLoud16drflac_read_funcEPvS0_m, ptr noundef @_ZN6SoLoud16drflac_seek_funcEPvi18drflac_seek_origin, ptr noundef %202, ptr noundef null)
          to label %204 unwind label %98

204:                                              ; preds = %200
  %205 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  store ptr %203, ptr %205, align 8, !tbaa !19
  %206 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  %207 = load ptr, ptr %206, align 8, !tbaa !19
  %208 = icmp ne ptr %207, null
  br i1 %208, label %228, label %209

209:                                              ; preds = %204
  %210 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %211 = load ptr, ptr %210, align 8, !tbaa !20
  %212 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %213 = load ptr, ptr %212, align 8, !tbaa !11
  %214 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %213, i32 0, i32 5
  %215 = load ptr, ptr %214, align 8, !tbaa !25
  %216 = icmp ne ptr %211, %215
  br i1 %216, label %217, label %226

217:                                              ; preds = %209
  %218 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %219 = load ptr, ptr %218, align 8, !tbaa !20
  %220 = icmp eq ptr %219, null
  br i1 %220, label %225, label %221

221:                                              ; preds = %217
  %222 = load ptr, ptr %219, align 8, !tbaa !9
  %223 = getelementptr inbounds ptr, ptr %222, i64 1
  %224 = load ptr, ptr %223, align 8
  call void %224(ptr noundef nonnull align 8 dereferenceable(8) %219) #6
  br label %225

225:                                              ; preds = %221, %217
  br label %226

226:                                              ; preds = %225, %209
  %227 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr null, ptr %227, align 8, !tbaa !20
  br label %228

228:                                              ; preds = %226, %204
  br label %292

229:                                              ; preds = %194
  %230 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %231 = load ptr, ptr %230, align 8, !tbaa !11
  %232 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %231, i32 0, i32 1
  %233 = load i32, ptr %232, align 8, !tbaa !26
  %234 = icmp eq i32 %233, 3
  br i1 %234, label %235, label %272

235:                                              ; preds = %229
  %236 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 21264) #7
          to label %237 unwind label %98

237:                                              ; preds = %235
  %238 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  store ptr %236, ptr %238, align 8, !tbaa !19
  %239 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  %240 = load ptr, ptr %239, align 8, !tbaa !19
  %241 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %242 = load ptr, ptr %241, align 8, !tbaa !20
  %243 = invoke i32 @drmp3_init(ptr noundef %240, ptr noundef @_ZN6SoLoud15drmp3_read_funcEPvS0_m, ptr noundef @_ZN6SoLoud15drmp3_seek_funcEPvi17drmp3_seek_origin, ptr noundef %242, ptr noundef null, ptr noundef null)
          to label %244 unwind label %98

244:                                              ; preds = %237
  %245 = icmp ne i32 %243, 0
  br i1 %245, label %271, label %246

246:                                              ; preds = %244
  %247 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  %248 = load ptr, ptr %247, align 8, !tbaa !19
  %249 = icmp eq ptr %248, null
  br i1 %249, label %251, label %250

250:                                              ; preds = %246
  call void @_ZdlPvm(ptr noundef %248, i64 noundef 21264) #8
  br label %251

251:                                              ; preds = %250, %246
  %252 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 4
  store ptr null, ptr %252, align 8, !tbaa !19
  %253 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %254 = load ptr, ptr %253, align 8, !tbaa !20
  %255 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %256 = load ptr, ptr %255, align 8, !tbaa !11
  %257 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %256, i32 0, i32 5
  %258 = load ptr, ptr %257, align 8, !tbaa !25
  %259 = icmp ne ptr %254, %258
  br i1 %259, label %260, label %269

260:                                              ; preds = %251
  %261 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %262 = load ptr, ptr %261, align 8, !tbaa !20
  %263 = icmp eq ptr %262, null
  br i1 %263, label %268, label %264

264:                                              ; preds = %260
  %265 = load ptr, ptr %262, align 8, !tbaa !9
  %266 = getelementptr inbounds ptr, ptr %265, i64 1
  %267 = load ptr, ptr %266, align 8
  call void %267(ptr noundef nonnull align 8 dereferenceable(8) %262) #6
  br label %268

268:                                              ; preds = %264, %260
  br label %269

269:                                              ; preds = %268, %251
  %270 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr null, ptr %270, align 8, !tbaa !20
  br label %271

271:                                              ; preds = %269, %244
  br label %291

272:                                              ; preds = %229
  %273 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %274 = load ptr, ptr %273, align 8, !tbaa !20
  %275 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 1
  %276 = load ptr, ptr %275, align 8, !tbaa !11
  %277 = getelementptr inbounds %"class.SoLoud::WavStream", ptr %276, i32 0, i32 5
  %278 = load ptr, ptr %277, align 8, !tbaa !25
  %279 = icmp ne ptr %274, %278
  br i1 %279, label %280, label %289

280:                                              ; preds = %272
  %281 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  %282 = load ptr, ptr %281, align 8, !tbaa !20
  %283 = icmp eq ptr %282, null
  br i1 %283, label %288, label %284

284:                                              ; preds = %280
  %285 = load ptr, ptr %282, align 8, !tbaa !9
  %286 = getelementptr inbounds ptr, ptr %285, i64 1
  %287 = load ptr, ptr %286, align 8
  call void %287(ptr noundef nonnull align 8 dereferenceable(8) %282) #6
  br label %288

288:                                              ; preds = %284, %280
  br label %289

289:                                              ; preds = %288, %272
  %290 = getelementptr inbounds %"class.SoLoud::WavStreamInstance", ptr %10, i32 0, i32 3
  store ptr null, ptr %290, align 8, !tbaa !20
  br label %295

291:                                              ; preds = %271
  br label %292

292:                                              ; preds = %291, %228
  br label %293

293:                                              ; preds = %292, %190
  br label %294

294:                                              ; preds = %293, %151
  br label %295

295:                                              ; preds = %294, %289, %105, %102
  ret void

296:                                              ; preds = %184, %98, %81, %55
  call void @_ZN6SoLoud19AudioSourceInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(496) %10) #6
  br label %297

297:                                              ; preds = %296
  %298 = load ptr, ptr %6, align 8
  %299 = load i32, ptr %7, align 4
  %300 = insertvalue { ptr, i32 } poison, ptr %298, 0
  %301 = insertvalue { ptr, i32 } %300, i32 %299, 1
  resume { ptr, i32 } %301
}

declare void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496)) unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6SoLoud10MemoryFileC1Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

declare noundef i32 @_ZN6SoLoud10MemoryFile7openMemEPKhjbb(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) #2

declare void @_ZN6SoLoud8DiskFileC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare noundef i32 @_ZN6SoLoud8DiskFile4openEPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #2

declare i32 @drwav_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @stb_vorbis_open_file(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare ptr @drflac_open(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @drmp3_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare void @_ZN6SoLoud19AudioSourceInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(496)) unnamed_addr #5

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nobuiltin allocsize(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 = { nobuiltin 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 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 496}
!12 = !{!"_ZTSN6SoLoud17WavStreamInstanceE", !13, i64 0, !6, i64 496, !14, i64 504, !6, i64 512, !7, i64 520, !14, i64 528, !14, i64 532, !6, i64 536}
!13 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !14, i64 8, !14, i64 12, !14, i64 16, !15, i64 20, !7, i64 24, !15, i64 56, !15, i64 60, !15, i64 64, !15, i64 68, !14, i64 72, !15, i64 76, !15, i64 80, !16, i64 88, !16, i64 96, !17, i64 104, !17, i64 152, !17, i64 200, !17, i64 248, !17, i64 296, !14, i64 344, !7, i64 348, !14, i64 380, !14, i64 384, !7, i64 392, !7, i64 456, !14, i64 472, !14, i64 476, !14, i64 480, !16, i64 488}
!14 = !{!"int", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTSN6SoLoud5FaderE", !15, i64 0, !15, i64 4, !15, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !15, i64 40, !14, i64 44}
!18 = !{!12, !14, i64 504}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !6, i64 512}
!21 = !{!22, !6, i64 168}
!22 = !{!"_ZTSN6SoLoud9WavStreamE", !23, i64 0, !14, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !14, i64 184}
!23 = !{!"_ZTSN6SoLoud11AudioSourceE", !14, i64 8, !15, i64 12, !15, i64 16, !14, i64 20, !14, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !14, i64 40, !15, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !16, i64 144}
!24 = !{!22, !6, i64 160}
!25 = !{!22, !6, i64 176}
!26 = !{!22, !14, i64 152}
!27 = !{!12, !14, i64 528}
!28 = !{!12, !14, i64 532}
!29 = !{!12, !6, i64 536}


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

@_ZTVN6SoLoud17WavStreamInstanceE = external dso_local unnamed_addr constant { [9 x ptr] }, align 8

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud17WavStreamInstanceC2EPNS_9WavStreamE(ptr noundef nonnull align 8 dereferenceable(544) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  tail call void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496) %0)
  store ptr getelementptr inbounds inrange(-16, 56) (i8, ptr @_ZTVN6SoLoud17WavStreamInstanceE, i64 16), ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 496
  store ptr %1, ptr %4, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 504
  store i32 0, ptr %5, align 8, !tbaa !17
  %6 = getelementptr inbounds i8, ptr %0, i64 520
  %7 = getelementptr inbounds i8, ptr %0, i64 512
  %8 = getelementptr inbounds i8, ptr %1, i64 168
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, i8 0, i64 16, i1 false)
  %9 = load ptr, ptr %8, align 8, !tbaa !18
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %31, label %10

10:                                               ; preds = %2
  %11 = invoke noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #7
          to label %12 unwind label %27

12:                                               ; preds = %10
  invoke void @_ZN6SoLoud10MemoryFileC1Ev(ptr noundef nonnull align 8 dereferenceable(25) %11)
          to label %13 unwind label %29

13:                                               ; preds = %12
  store ptr %11, ptr %7, align 8, !tbaa !21
  %14 = load ptr, ptr %8, align 8, !tbaa !18
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 64
  %17 = load ptr, ptr %16, align 8
  %18 = invoke noundef ptr %17(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %19 unwind label %27

19:                                               ; preds = %13
  %20 = load ptr, ptr %8, align 8, !tbaa !18
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 32
  %23 = load ptr, ptr %22, align 8
  %24 = invoke noundef i32 %23(ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %25 unwind label %27

25:                                               ; preds = %19
  %26 = invoke noundef i32 @_ZN6SoLoud10MemoryFile7openMemEPKhjbb(ptr noundef nonnull align 8 dereferenceable(25) %11, ptr noundef %18, i32 noundef %24, i1 noundef zeroext false, i1 noundef zeroext false)
          to label %53 unwind label %27

27:                                               ; preds = %25, %19, %13, %10
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %140

29:                                               ; preds = %12
  %30 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %11, i64 noundef 32) #8
  br label %140

31:                                               ; preds = %2
  %32 = getelementptr inbounds i8, ptr %1, i64 160
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  %.not26 = icmp eq ptr %33, null
  br i1 %.not26, label %44, label %34

34:                                               ; preds = %31
  %35 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
          to label %36 unwind label %40

36:                                               ; preds = %34
  invoke void @_ZN6SoLoud8DiskFileC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %35)
          to label %37 unwind label %42

37:                                               ; preds = %36
  store ptr %35, ptr %7, align 8, !tbaa !21
  %38 = load ptr, ptr %32, align 8, !tbaa !22
  %39 = invoke noundef i32 @_ZN6SoLoud8DiskFile4openEPKc(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef %38)
          to label %53 unwind label %40

40:                                               ; preds = %37, %34
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %140

42:                                               ; preds = %36
  %43 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %35, i64 noundef 16) #8
  br label %140

44:                                               ; preds = %31
  %45 = getelementptr inbounds i8, ptr %1, i64 176
  %46 = load ptr, ptr %45, align 8, !tbaa !23
  %.not27 = icmp eq ptr %46, null
  br i1 %.not27, label %139, label %47

47:                                               ; preds = %44
  store ptr %46, ptr %7, align 8, !tbaa !21
  %48 = load ptr, ptr %46, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  %50 = load ptr, ptr %49, align 8
  invoke void %50(ptr noundef nonnull align 8 dereferenceable(8) %46, i32 noundef 0)
          to label %53 unwind label %51

51:                                               ; preds = %113, %111, %97, %61, %59, %47
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %140

53:                                               ; preds = %37, %25, %47
  %54 = load ptr, ptr %7, align 8, !tbaa !21
  %.not31 = icmp eq ptr %54, null
  br i1 %.not31, label %139, label %55

55:                                               ; preds = %53
  %56 = load ptr, ptr %4, align 8, !tbaa !8
  %57 = getelementptr inbounds i8, ptr %56, i64 152
  %58 = load i32, ptr %57, align 8, !tbaa !24
  switch i32 %58, label %131 [
    i32 0, label %59
    i32 1, label %79
    i32 2, label %97
    i32 3, label %111
  ]

59:                                               ; preds = %55
  %60 = invoke noalias noundef nonnull dereferenceable(440) ptr @_Znwm(i64 noundef 440) #7
          to label %61 unwind label %51

61:                                               ; preds = %59
  store ptr %60, ptr %6, align 8, !tbaa !25
  %62 = invoke i32 @drwav_init(ptr noundef nonnull %60, ptr noundef nonnull @_ZN6SoLoud15drwav_read_funcEPvS0_m, ptr noundef nonnull @_ZN6SoLoud15drwav_seek_funcEPvi17drwav_seek_origin, ptr noundef nonnull %54, ptr noundef null)
          to label %63 unwind label %51

63:                                               ; preds = %61
  %.not41 = icmp eq i32 %62, 0
  br i1 %.not41, label %64, label %139

64:                                               ; preds = %63
  %65 = load ptr, ptr %6, align 8, !tbaa !25
  %66 = icmp eq ptr %65, null
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  tail call void @_ZdlPvm(ptr noundef nonnull %65, i64 noundef 440) #8
  br label %68

68:                                               ; preds = %67, %64
  store ptr null, ptr %6, align 8, !tbaa !25
  %69 = load ptr, ptr %7, align 8, !tbaa !21
  %70 = load ptr, ptr %4, align 8, !tbaa !8
  %71 = getelementptr inbounds i8, ptr %70, i64 176
  %72 = load ptr, ptr %71, align 8, !tbaa !23
  %.not42 = icmp eq ptr %69, %72
  %73 = icmp eq ptr %69, null
  %or.cond = or i1 %73, %.not42
  br i1 %or.cond, label %78, label %74

74:                                               ; preds = %68
  %75 = load ptr, ptr %69, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = load ptr, ptr %76, align 8
  tail call void %77(ptr noundef nonnull align 8 dereferenceable(8) %69) #9
  br label %78

78:                                               ; preds = %74, %68
  store ptr null, ptr %7, align 8, !tbaa !21
  br label %139

79:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %80 = invoke ptr @stb_vorbis_open_file(ptr noundef nonnull %54, i32 noundef 0, ptr noundef nonnull %3, ptr noundef null)
          to label %81 unwind label %92

81:                                               ; preds = %79
  store ptr %80, ptr %6, align 8, !tbaa !25
  %.not37 = icmp eq ptr %80, null
  br i1 %.not37, label %82, label %95

82:                                               ; preds = %81
  %83 = load ptr, ptr %7, align 8, !tbaa !21
  %84 = load ptr, ptr %4, align 8, !tbaa !8
  %85 = getelementptr inbounds i8, ptr %84, i64 176
  %86 = load ptr, ptr %85, align 8, !tbaa !23
  %.not38 = icmp eq ptr %83, %86
  %87 = icmp eq ptr %83, null
  %or.cond43 = or i1 %87, %.not38
  br i1 %or.cond43, label %94, label %88

88:                                               ; preds = %82
  %89 = load ptr, ptr %83, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = load ptr, ptr %90, align 8
  call void %91(ptr noundef nonnull align 8 dereferenceable(8) %83) #9
  br label %94

92:                                               ; preds = %79
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  br label %140

94:                                               ; preds = %88, %82
  store ptr null, ptr %7, align 8, !tbaa !21
  br label %95

95:                                               ; preds = %94, %81
  %96 = getelementptr inbounds i8, ptr %0, i64 528
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %96, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  br label %139

97:                                               ; preds = %55
  %98 = invoke ptr @drflac_open(ptr noundef nonnull @_ZN6SoLoud16drflac_read_funcEPvS0_m, ptr noundef nonnull @_ZN6SoLoud16drflac_seek_funcEPvi18drflac_seek_origin, ptr noundef nonnull %54, ptr noundef null)
          to label %99 unwind label %51

99:                                               ; preds = %97
  store ptr %98, ptr %6, align 8, !tbaa !25
  %.not35 = icmp eq ptr %98, null
  br i1 %.not35, label %100, label %139

100:                                              ; preds = %99
  %101 = load ptr, ptr %7, align 8, !tbaa !21
  %102 = load ptr, ptr %4, align 8, !tbaa !8
  %103 = getelementptr inbounds i8, ptr %102, i64 176
  %104 = load ptr, ptr %103, align 8, !tbaa !23
  %.not36 = icmp eq ptr %101, %104
  %105 = icmp eq ptr %101, null
  %or.cond44 = or i1 %105, %.not36
  br i1 %or.cond44, label %110, label %106

106:                                              ; preds = %100
  %107 = load ptr, ptr %101, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i64 8
  %109 = load ptr, ptr %108, align 8
  tail call void %109(ptr noundef nonnull align 8 dereferenceable(8) %101) #9
  br label %110

110:                                              ; preds = %106, %100
  store ptr null, ptr %7, align 8, !tbaa !21
  br label %139

111:                                              ; preds = %55
  %112 = invoke noalias noundef nonnull dereferenceable(21264) ptr @_Znwm(i64 noundef 21264) #7
          to label %113 unwind label %51

113:                                              ; preds = %111
  store ptr %112, ptr %6, align 8, !tbaa !25
  %114 = invoke i32 @drmp3_init(ptr noundef nonnull %112, ptr noundef nonnull @_ZN6SoLoud15drmp3_read_funcEPvS0_m, ptr noundef nonnull @_ZN6SoLoud15drmp3_seek_funcEPvi17drmp3_seek_origin, ptr noundef nonnull %54, ptr noundef null, ptr noundef null)
          to label %115 unwind label %51

115:                                              ; preds = %113
  %.not33 = icmp eq i32 %114, 0
  br i1 %.not33, label %116, label %139

116:                                              ; preds = %115
  %117 = load ptr, ptr %6, align 8, !tbaa !25
  %118 = icmp eq ptr %117, null
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  tail call void @_ZdlPvm(ptr noundef nonnull %117, i64 noundef 21264) #8
  br label %120

120:                                              ; preds = %119, %116
  store ptr null, ptr %6, align 8, !tbaa !25
  %121 = load ptr, ptr %7, align 8, !tbaa !21
  %122 = load ptr, ptr %4, align 8, !tbaa !8
  %123 = getelementptr inbounds i8, ptr %122, i64 176
  %124 = load ptr, ptr %123, align 8, !tbaa !23
  %.not34 = icmp eq ptr %121, %124
  %125 = icmp eq ptr %121, null
  %or.cond45 = or i1 %125, %.not34
  br i1 %or.cond45, label %130, label %126

126:                                              ; preds = %120
  %127 = load ptr, ptr %121, align 8, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %127, i64 8
  %129 = load ptr, ptr %128, align 8
  tail call void %129(ptr noundef nonnull align 8 dereferenceable(8) %121) #9
  br label %130

130:                                              ; preds = %126, %120
  store ptr null, ptr %7, align 8, !tbaa !21
  br label %139

131:                                              ; preds = %55
  %132 = getelementptr inbounds i8, ptr %56, i64 176
  %133 = load ptr, ptr %132, align 8, !tbaa !23
  %.not32 = icmp eq ptr %54, %133
  br i1 %.not32, label %138, label %134

134:                                              ; preds = %131
  %135 = load ptr, ptr %54, align 8, !tbaa !5
  %136 = getelementptr inbounds i8, ptr %135, i64 8
  %137 = load ptr, ptr %136, align 8
  tail call void %137(ptr noundef nonnull align 8 dereferenceable(8) %54) #9
  br label %138

138:                                              ; preds = %134, %131
  store ptr null, ptr %7, align 8, !tbaa !21
  br label %139

139:                                              ; preds = %78, %63, %110, %99, %115, %130, %95, %44, %138, %53
  ret void

140:                                              ; preds = %40, %42, %27, %29, %92, %51
  %.pn39 = phi { ptr, i32 } [ %52, %51 ], [ %93, %92 ], [ %28, %27 ], [ %30, %29 ], [ %41, %40 ], [ %43, %42 ]
  call void @_ZN6SoLoud19AudioSourceInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(496) %0) #9
  resume { ptr, i32 } %.pn39
}

declare void @_ZN6SoLoud19AudioSourceInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(496)) unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6SoLoud10MemoryFileC1Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

declare noundef i32 @_ZN6SoLoud10MemoryFile7openMemEPKhjbb(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #2

declare void @_ZN6SoLoud8DiskFileC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare noundef i32 @_ZN6SoLoud8DiskFile4openEPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #2

declare i32 @drwav_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @stb_vorbis_open_file(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @drflac_open(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @drmp3_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN6SoLoud19AudioSourceInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(496)) unnamed_addr #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nobuiltin allocsize(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 = { nobuiltin 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 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }
attributes #9 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !16, i64 496}
!9 = !{!"_ZTSN6SoLoud17WavStreamInstanceE", !10, i64 0, !16, i64 496, !11, i64 504, !16, i64 512, !12, i64 520, !11, i64 528, !11, i64 532, !16, i64 536}
!10 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !11, i64 8, !11, i64 12, !11, i64 16, !13, i64 20, !12, i64 24, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !11, i64 72, !13, i64 76, !13, i64 80, !14, i64 88, !14, i64 96, !15, i64 104, !15, i64 152, !15, i64 200, !15, i64 248, !15, i64 296, !11, i64 344, !12, i64 348, !11, i64 380, !11, i64 384, !12, i64 392, !12, i64 456, !11, i64 472, !11, i64 476, !11, i64 480, !14, i64 488}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"float", !12, i64 0}
!14 = !{!"double", !12, i64 0}
!15 = !{!"_ZTSN6SoLoud5FaderE", !13, i64 0, !13, i64 4, !13, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !13, i64 40, !11, i64 44}
!16 = !{!"any pointer", !12, i64 0}
!17 = !{!9, !11, i64 504}
!18 = !{!19, !16, i64 168}
!19 = !{!"_ZTSN6SoLoud9WavStreamE", !20, i64 0, !11, i64 152, !16, i64 160, !16, i64 168, !16, i64 176, !11, i64 184}
!20 = !{!"_ZTSN6SoLoud11AudioSourceE", !11, i64 8, !13, i64 12, !13, i64 16, !11, i64 20, !11, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !11, i64 40, !13, i64 44, !12, i64 48, !16, i64 112, !16, i64 120, !16, i64 128, !11, i64 136, !14, i64 144}
!21 = !{!9, !16, i64 512}
!22 = !{!19, !16, i64 160}
!23 = !{!19, !16, i64 176}
!24 = !{!19, !11, i64 152}
!25 = !{!12, !12, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass