; LLVM IR from merpheus-dev/LavaEngine :: src/Utils/soloud/src/core/soloud_bus.ll (ZN6SoLoud11BusInstance8getAudioEPfjj)

; 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::BusInstance" = type { %"class.SoLoud::AudioSourceInstance", ptr, i32, [4 x i8], %"class.SoLoud::AlignedFloatBuffer", [8 x float], [256 x float] }
%"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 }
%"class.SoLoud::AlignedFloatBuffer" = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.SoLoud::Bus" = type <{ %"class.SoLoud::AudioSource", ptr, i32, [256 x float], [256 x float], [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 }
%"class.SoLoud::Soloud" = type <{ ptr, ptr, i8, [7 x i8], ptr, i32, i32, %"class.SoLoud::AlignedFloatBuffer", i32, i32, %"class.SoLoud::AlignedFloatBuffer", ptr, ptr, [1024 x ptr], i32, i32, i32, [4 x i8], ptr, i32, i32, float, float, i32, i32, %"class.SoLoud::Fader", double, double, [8 x ptr], [8 x ptr], [8 x float], [256 x float], [256 x float], [256 x float], [3 x float], [3 x float], [3 x float], [3 x float], float, [24 x float], [4 x i8], [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr, i32, [1024 x i32], i32, i8, [7 x i8] }>
%"class.SoLoud::AudioSourceInstance3dData" = type <{ [3 x float], [3 x float], float, float, float, i32, float, [4 x i8], ptr, ptr, i32, float, float, [8 x float], i32, i32, [4 x i8] }>

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud11BusInstance8getAudioEPfjj(ptr noundef nonnull align 8 dereferenceable(1592) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) unnamed_addr #1 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca i32, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  %21 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %22 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds %"class.SoLoud::Bus", ptr %23, i32 0, i32 2
  %25 = load i32, ptr %24, align 8, !tbaa !18
  store i32 %25, ptr %10, align 4, !tbaa !9
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %46

28:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %41, %28
  %30 = load i32, ptr %11, align 4, !tbaa !9
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 10
  %33 = load i32, ptr %32, align 8, !tbaa !21
  %34 = mul i32 %31, %33
  %35 = icmp ult i32 %30, %34
  br i1 %35, label %36, label %44

36:                                               ; preds = %29
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds float, ptr %37, i64 %39
  store float 0.000000e+00, ptr %40, align 4, !tbaa !22
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = add i32 %42, 1
  store i32 %43, ptr %11, align 4, !tbaa !9
  br label %29, !llvm.loop !23

44:                                               ; preds = %29
  %45 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %45, ptr %5, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %216

46:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %47 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %48, i32 0, i32 12
  %50 = load ptr, ptr %49, align 8, !tbaa !25
  store ptr %50, ptr %13, align 8, !tbaa !5
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %51, i32 0, i32 9
  %53 = load i32, ptr %52, align 4, !tbaa !26
  %54 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 2
  %55 = load i32, ptr %54, align 8, !tbaa !29
  %56 = icmp ne i32 %53, %55
  br i1 %56, label %57, label %67

57:                                               ; preds = %46
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %58, i32 0, i32 9
  %60 = load i32, ptr %59, align 4, !tbaa !26
  %61 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 2
  store i32 %60, ptr %61, align 8, !tbaa !29
  %62 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 4
  %63 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 2
  %64 = load i32, ptr %63, align 8, !tbaa !29
  %65 = mul i32 %64, 8
  %66 = call noundef i32 @_ZN6SoLoud18AlignedFloatBuffer4initEj(ptr noundef nonnull align 8 dereferenceable(20) %62, i32 noundef %65)
  br label %67

67:                                               ; preds = %57, %46
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 4
  %73 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !30
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 9
  %77 = load float, ptr %76, align 4, !tbaa !31
  %78 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 10
  %79 = load i32, ptr %78, align 8, !tbaa !21
  call void @_ZN6SoLoud6Soloud15mixBus_internalEPfjjS1_jfj(ptr noundef nonnull align 8 dereferenceable(138793) %68, ptr noundef %69, i32 noundef %70, i32 noundef %71, ptr noundef %74, i32 noundef %75, float noundef %77, i32 noundef %79)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %80 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  %82 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %81, i32 0, i32 1
  %83 = load i32, ptr %82, align 8, !tbaa !32
  %84 = and i32 %83, 4
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %214

86:                                               ; preds = %67
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %95, %86
  %88 = load i32, ptr %14, align 4, !tbaa !9
  %89 = icmp slt i32 %88, 8
  br i1 %89, label %90, label %98

90:                                               ; preds = %87
  %91 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %92 = load i32, ptr %14, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [8 x float], ptr %91, i64 0, i64 %93
  store float 0.000000e+00, ptr %94, align 4, !tbaa !22
  br label %95

95:                                               ; preds = %90
  %96 = load i32, ptr %14, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %14, align 4, !tbaa !9
  br label %87, !llvm.loop !33

98:                                               ; preds = %87
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = icmp ugt i32 %99, 255
  br i1 %100, label %101, label %156

101:                                              ; preds = %98
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %152, %101
  %103 = load i32, ptr %14, align 4, !tbaa !9
  %104 = icmp slt i32 %103, 256
  br i1 %104, label %105, label %155

105:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %106 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 6
  %107 = load i32, ptr %14, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [256 x float], ptr %106, i64 0, i64 %108
  store float 0.000000e+00, ptr %109, align 4, !tbaa !22
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %148, %105
  %111 = load i32, ptr %15, align 4, !tbaa !9
  %112 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 10
  %113 = load i32, ptr %112, align 8, !tbaa !21
  %114 = icmp slt i32 %111, %113
  br i1 %114, label %115, label %151

115:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = load i32, ptr %9, align 4, !tbaa !9
  %119 = load i32, ptr %15, align 4, !tbaa !9
  %120 = mul i32 %118, %119
  %121 = add i32 %117, %120
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds float, ptr %116, i64 %122
  %124 = load float, ptr %123, align 4, !tbaa !22
  store float %124, ptr %16, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %125 = load float, ptr %16, align 4, !tbaa !22
  %126 = call noundef float @_ZSt4fabsf(float noundef %125)
  store float %126, ptr %17, align 4, !tbaa !22
  %127 = load float, ptr %17, align 4, !tbaa !22
  %128 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %129 = load i32, ptr %15, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [8 x float], ptr %128, i64 0, i64 %130
  %132 = load float, ptr %131, align 4, !tbaa !22
  %133 = fcmp ogt float %127, %132
  br i1 %133, label %134, label %140

134:                                              ; preds = %115
  %135 = load float, ptr %17, align 4, !tbaa !22
  %136 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %137 = load i32, ptr %15, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [8 x float], ptr %136, i64 0, i64 %138
  store float %135, ptr %139, align 4, !tbaa !22
  br label %140

140:                                              ; preds = %134, %115
  %141 = load float, ptr %16, align 4, !tbaa !22
  %142 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 6
  %143 = load i32, ptr %14, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [256 x float], ptr %142, i64 0, i64 %144
  %146 = load float, ptr %145, align 4, !tbaa !22
  %147 = fadd float %146, %141
  store float %147, ptr %145, align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %148

148:                                              ; preds = %140
  %149 = load i32, ptr %15, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %15, align 4, !tbaa !9
  br label %110, !llvm.loop !34

151:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %14, align 4, !tbaa !9
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %14, align 4, !tbaa !9
  br label %102, !llvm.loop !35

155:                                              ; preds = %102
  br label %213

156:                                              ; preds = %98
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %209, %156
  %158 = load i32, ptr %14, align 4, !tbaa !9
  %159 = icmp slt i32 %158, 256
  br i1 %159, label %160, label %212

160:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %161 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 6
  %162 = load i32, ptr %14, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [256 x float], ptr %161, i64 0, i64 %163
  store float 0.000000e+00, ptr %164, align 4, !tbaa !22
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %165

165:                                              ; preds = %205, %160
  %166 = load i32, ptr %18, align 4, !tbaa !9
  %167 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 10
  %168 = load i32, ptr %167, align 8, !tbaa !21
  %169 = icmp slt i32 %166, %168
  br i1 %169, label %170, label %208

170:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = load i32, ptr %14, align 4, !tbaa !9
  %173 = load i32, ptr %8, align 4, !tbaa !9
  %174 = urem i32 %172, %173
  %175 = load i32, ptr %9, align 4, !tbaa !9
  %176 = load i32, ptr %18, align 4, !tbaa !9
  %177 = mul i32 %175, %176
  %178 = add i32 %174, %177
  %179 = zext i32 %178 to i64
  %180 = getelementptr inbounds float, ptr %171, i64 %179
  %181 = load float, ptr %180, align 4, !tbaa !22
  store float %181, ptr %19, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %182 = load float, ptr %19, align 4, !tbaa !22
  %183 = call noundef float @_ZSt4fabsf(float noundef %182)
  store float %183, ptr %20, align 4, !tbaa !22
  %184 = load float, ptr %20, align 4, !tbaa !22
  %185 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %186 = load i32, ptr %18, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [8 x float], ptr %185, i64 0, i64 %187
  %189 = load float, ptr %188, align 4, !tbaa !22
  %190 = fcmp ogt float %184, %189
  br i1 %190, label %191, label %197

191:                                              ; preds = %170
  %192 = load float, ptr %20, align 4, !tbaa !22
  %193 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %194 = load i32, ptr %18, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [8 x float], ptr %193, i64 0, i64 %195
  store float %192, ptr %196, align 4, !tbaa !22
  br label %197

197:                                              ; preds = %191, %170
  %198 = load float, ptr %19, align 4, !tbaa !22
  %199 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 6
  %200 = load i32, ptr %14, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [256 x float], ptr %199, i64 0, i64 %201
  %203 = load float, ptr %202, align 4, !tbaa !22
  %204 = fadd float %203, %198
  store float %204, ptr %202, align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %205

205:                                              ; preds = %197
  %206 = load i32, ptr %18, align 4, !tbaa !9
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %18, align 4, !tbaa !9
  br label %165, !llvm.loop !36

208:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %209

209:                                              ; preds = %208
  %210 = load i32, ptr %14, align 4, !tbaa !9
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %14, align 4, !tbaa !9
  br label %157, !llvm.loop !37

212:                                              ; preds = %157
  br label %213

213:                                              ; preds = %212, %155
  br label %214

214:                                              ; preds = %213, %67
  %215 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %215, ptr %5, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %216

216:                                              ; preds = %214, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %217 = load i32, ptr %5, align 4
  ret i32 %217
}

declare noundef i32 @_ZN6SoLoud18AlignedFloatBuffer4initEj(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #2

declare void @_ZN6SoLoud6Soloud15mixBus_internalEPfjjS1_jfj(ptr noundef nonnull align 8 dereferenceable(138793), ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fabsf(float noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { inlinehint 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 496}
!12 = !{!"_ZTSN6SoLoud11BusInstanceE", !13, i64 0, !6, i64 496, !10, i64 504, !17, i64 512, !7, i64 536, !7, i64 568}
!13 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !10, i64 8, !10, i64 12, !10, i64 16, !14, i64 20, !7, i64 24, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !10, i64 72, !14, i64 76, !14, i64 80, !15, i64 88, !15, i64 96, !16, i64 104, !16, i64 152, !16, i64 200, !16, i64 248, !16, i64 296, !10, i64 344, !7, i64 348, !10, i64 380, !10, i64 384, !7, i64 392, !7, i64 456, !10, i64 472, !10, i64 476, !10, i64 480, !15, i64 488}
!14 = !{!"float", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTSN6SoLoud5FaderE", !14, i64 0, !14, i64 4, !14, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !14, i64 40, !10, i64 44}
!17 = !{!"_ZTSN6SoLoud18AlignedFloatBufferE", !6, i64 0, !6, i64 8, !10, i64 16}
!18 = !{!19, !10, i64 160}
!19 = !{!"_ZTSN6SoLoud3BusE", !20, i64 0, !6, i64 152, !10, i64 160, !7, i64 164, !7, i64 1188}
!20 = !{!"_ZTSN6SoLoud11AudioSourceE", !10, i64 8, !14, i64 12, !14, i64 16, !10, i64 20, !10, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !10, i64 40, !14, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !10, i64 136, !15, i64 144}
!21 = !{!13, !10, i64 72}
!22 = !{!14, !14, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!20, !6, i64 112}
!26 = !{!27, !10, i64 68}
!27 = !{!"_ZTSN6SoLoud6SoloudE", !6, i64 0, !6, i64 8, !28, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !17, i64 40, !10, i64 64, !10, i64 68, !17, i64 72, !6, i64 96, !6, i64 104, !7, i64 112, !10, i64 8304, !10, i64 8308, !10, i64 8312, !6, i64 8320, !10, i64 8328, !10, i64 8332, !14, i64 8336, !14, i64 8340, !10, i64 8344, !10, i64 8348, !16, i64 8352, !15, i64 8400, !15, i64 8408, !7, i64 8416, !7, i64 8480, !7, i64 8544, !7, i64 8576, !7, i64 9600, !7, i64 10624, !7, i64 11648, !7, i64 11660, !7, i64 11672, !7, i64 11684, !14, i64 11696, !7, i64 11700, !7, i64 11800, !6, i64 134680, !10, i64 134688, !7, i64 134692, !10, i64 138788, !28, i64 138792}
!28 = !{!"bool", !7, i64 0}
!29 = !{!12, !10, i64 504}
!30 = !{!12, !6, i64 512}
!31 = !{!13, !14, i64 68}
!32 = !{!20, !10, i64 8}
!33 = distinct !{!33, !24}
!34 = distinct !{!34, !24}
!35 = distinct !{!35, !24}
!36 = distinct !{!36, !24}
!37 = distinct !{!37, !24}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud11BusInstance8getAudioEPfjj(ptr noundef nonnull align 8 dereferenceable(1592) %0, ptr noundef %1, i32 noundef returned %2, i32 noundef %3) unnamed_addr #0 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 496
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 160
  %8 = load i32, ptr %7, align 8, !tbaa !16
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %.preheader, label %15

.preheader:                                       ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 72
  %11 = load i32, ptr %10, align 8, !tbaa !19
  %12 = mul i32 %11, %3
  %.not77 = icmp eq i32 %12, 0
  br i1 %.not77, label %.loopexit, label %.lr.ph76.preheader

.lr.ph76.preheader:                               ; preds = %.preheader
  %13 = zext i32 %12 to i64
  %14 = shl nuw nsw i64 %13, 2
  tail call void @llvm.memset.p0.i64(ptr align 4 %1, i8 0, i64 %14, i1 false), !tbaa !20
  br label %.loopexit

15:                                               ; preds = %4
  %16 = getelementptr inbounds i8, ptr %6, i64 112
  %17 = load ptr, ptr %16, align 8, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %17, i64 68
  %19 = load i32, ptr %18, align 4, !tbaa !22
  %20 = getelementptr inbounds i8, ptr %0, i64 504
  %21 = load i32, ptr %20, align 8, !tbaa !25
  %.not = icmp eq i32 %19, %21
  br i1 %.not, label %26, label %22

22:                                               ; preds = %15
  store i32 %19, ptr %20, align 8, !tbaa !25
  %23 = getelementptr inbounds i8, ptr %0, i64 512
  %24 = shl i32 %19, 3
  %25 = tail call noundef i32 @_ZN6SoLoud18AlignedFloatBuffer4initEj(ptr noundef nonnull align 8 dereferenceable(20) %23, i32 noundef %24)
  br label %26

26:                                               ; preds = %22, %15
  %27 = getelementptr inbounds i8, ptr %0, i64 512
  %28 = load ptr, ptr %27, align 8, !tbaa !26
  %29 = getelementptr inbounds i8, ptr %0, i64 68
  %30 = load float, ptr %29, align 4, !tbaa !27
  %31 = getelementptr inbounds i8, ptr %0, i64 72
  %32 = load i32, ptr %31, align 8, !tbaa !19
  tail call void @_ZN6SoLoud6Soloud15mixBus_internalEPfjjS1_jfj(ptr noundef nonnull align 8 dereferenceable(138793) %17, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %28, i32 noundef %8, float noundef %30, i32 noundef %32)
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load i32, ptr %34, align 8, !tbaa !28
  %36 = and i32 %35, 4
  %.not61 = icmp eq i32 %36, 0
  br i1 %.not61, label %.loopexit, label %.preheader66

.preheader66:                                     ; preds = %26
  %37 = getelementptr inbounds i8, ptr %0, i64 536
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %37, i8 0, i64 32, i1 false), !tbaa !20
  %38 = icmp ugt i32 %2, 255
  %39 = getelementptr inbounds i8, ptr %0, i64 568
  %40 = load i32, ptr %31, align 8, !tbaa !19
  %41 = icmp sgt i32 %40, 0
  br i1 %38, label %.preheader62, label %.preheader64

.preheader64:                                     ; preds = %.preheader66
  br i1 %41, label %.preheader64.split, label %.preheader64.split.us.preheader

.preheader64.split.us.preheader:                  ; preds = %.preheader64
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1024) %39, i8 0, i64 1024, i1 false), !tbaa !20
  br label %.loopexit

.preheader62:                                     ; preds = %.preheader66
  br i1 %41, label %.preheader62.split, label %.preheader62.split.us.preheader

.preheader62.split.us.preheader:                  ; preds = %.preheader62
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1024) %39, i8 0, i64 1024, i1 false), !tbaa !20
  br label %.loopexit

.preheader62.split:                               ; preds = %.preheader62, %._crit_edge73
  %42 = phi i32 [ %63, %._crit_edge73 ], [ %40, %.preheader62 ]
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %._crit_edge73 ], [ 0, %.preheader62 ]
  %43 = getelementptr inbounds [256 x float], ptr %39, i64 0, i64 %indvars.iv94
  store float 0.000000e+00, ptr %43, align 4, !tbaa !20
  %44 = icmp sgt i32 %42, 0
  br i1 %44, label %.lr.ph72.preheader, label %._crit_edge73

.lr.ph72.preheader:                               ; preds = %.preheader62.split
  %45 = trunc nuw nsw i64 %indvars.iv94 to i32
  br label %.lr.ph72

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %57
  %indvars.iv91 = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next92, %57 ]
  %46 = trunc nuw nsw i64 %indvars.iv91 to i32
  %47 = mul i32 %46, %3
  %48 = add i32 %47, %45
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds float, ptr %1, i64 %49
  %51 = load float, ptr %50, align 4, !tbaa !20
  %52 = tail call noundef float @_ZSt4fabsf(float noundef %51)
  %53 = getelementptr inbounds [8 x float], ptr %37, i64 0, i64 %indvars.iv91
  %54 = load float, ptr %53, align 4, !tbaa !20
  %55 = fcmp ogt float %52, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %.lr.ph72
  store float %52, ptr %53, align 4, !tbaa !20
  br label %57

57:                                               ; preds = %56, %.lr.ph72
  %58 = load float, ptr %43, align 4, !tbaa !20
  %59 = fadd float %51, %58
  store float %59, ptr %43, align 4, !tbaa !20
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %60 = load i32, ptr %31, align 8, !tbaa !19
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next92, %61
  br i1 %62, label %.lr.ph72, label %._crit_edge73, !llvm.loop !29

._crit_edge73:                                    ; preds = %57, %.preheader62.split
  %63 = phi i32 [ %42, %.preheader62.split ], [ %60, %57 ]
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next95, 256
  br i1 %exitcond97.not, label %.loopexit, label %.preheader62.split, !llvm.loop !31

.preheader64.split:                               ; preds = %.preheader64, %._crit_edge
  %64 = phi i32 [ %87, %._crit_edge ], [ %40, %.preheader64 ]
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %._crit_edge ], [ 0, %.preheader64 ]
  %65 = getelementptr inbounds [256 x float], ptr %39, i64 0, i64 %indvars.iv85
  store float 0.000000e+00, ptr %65, align 4, !tbaa !20
  %66 = icmp sgt i32 %64, 0
  br i1 %66, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader64.split
  %67 = trunc nuw nsw i64 %indvars.iv85 to i32
  %68 = urem i32 %67, %2
  br label %69

69:                                               ; preds = %.lr.ph, %81
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %81 ]
  %70 = trunc nuw nsw i64 %indvars.iv to i32
  %71 = mul i32 %70, %3
  %72 = add i32 %68, %71
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds float, ptr %1, i64 %73
  %75 = load float, ptr %74, align 4, !tbaa !20
  %76 = tail call noundef float @_ZSt4fabsf(float noundef %75)
  %77 = getelementptr inbounds [8 x float], ptr %37, i64 0, i64 %indvars.iv
  %78 = load float, ptr %77, align 4, !tbaa !20
  %79 = fcmp ogt float %76, %78
  br i1 %79, label %80, label %81

80:                                               ; preds = %69
  store float %76, ptr %77, align 4, !tbaa !20
  br label %81

81:                                               ; preds = %80, %69
  %82 = load float, ptr %65, align 4, !tbaa !20
  %83 = fadd float %75, %82
  store float %83, ptr %65, align 4, !tbaa !20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %84 = load i32, ptr %31, align 8, !tbaa !19
  %85 = sext i32 %84 to i64
  %86 = icmp slt i64 %indvars.iv.next, %85
  br i1 %86, label %69, label %._crit_edge, !llvm.loop !33

._crit_edge:                                      ; preds = %81, %.preheader64.split
  %87 = phi i32 [ %64, %.preheader64.split ], [ %84, %81 ]
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next86, 256
  br i1 %exitcond.not, label %.loopexit, label %.preheader64.split, !llvm.loop !34

.loopexit:                                        ; preds = %._crit_edge, %._crit_edge73, %.preheader64.split.us.preheader, %.preheader62.split.us.preheader, %.lr.ph76.preheader, %.preheader, %26
  ret i32 %2
}

declare noundef i32 @_ZN6SoLoud18AlignedFloatBuffer4initEj(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #1

declare void @_ZN6SoLoud6Soloud15mixBus_internalEPfjjS1_jfj(ptr noundef nonnull align 8 dereferenceable(138793), ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fabsf(float noundef) local_unnamed_addr #2

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

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 = { "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 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !14, i64 496}
!6 = !{!"_ZTSN6SoLoud11BusInstanceE", !7, i64 0, !14, i64 496, !8, i64 504, !15, i64 512, !9, i64 536, !9, i64 568}
!7 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !8, i64 8, !8, i64 12, !8, i64 16, !11, i64 20, !9, i64 24, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !8, i64 72, !11, i64 76, !11, i64 80, !12, i64 88, !12, i64 96, !13, i64 104, !13, i64 152, !13, i64 200, !13, i64 248, !13, i64 296, !8, i64 344, !9, i64 348, !8, i64 380, !8, i64 384, !9, i64 392, !9, i64 456, !8, i64 472, !8, i64 476, !8, i64 480, !12, i64 488}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"double", !9, i64 0}
!13 = !{!"_ZTSN6SoLoud5FaderE", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !11, i64 40, !8, i64 44}
!14 = !{!"any pointer", !9, i64 0}
!15 = !{!"_ZTSN6SoLoud18AlignedFloatBufferE", !14, i64 0, !14, i64 8, !8, i64 16}
!16 = !{!17, !8, i64 160}
!17 = !{!"_ZTSN6SoLoud3BusE", !18, i64 0, !14, i64 152, !8, i64 160, !9, i64 164, !9, i64 1188}
!18 = !{!"_ZTSN6SoLoud11AudioSourceE", !8, i64 8, !11, i64 12, !11, i64 16, !8, i64 20, !8, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !11, i64 44, !9, i64 48, !14, i64 112, !14, i64 120, !14, i64 128, !8, i64 136, !12, i64 144}
!19 = !{!7, !8, i64 72}
!20 = !{!11, !11, i64 0}
!21 = !{!18, !14, i64 112}
!22 = !{!23, !8, i64 68}
!23 = !{!"_ZTSN6SoLoud6SoloudE", !14, i64 0, !14, i64 8, !24, i64 16, !14, i64 24, !8, i64 32, !8, i64 36, !15, i64 40, !8, i64 64, !8, i64 68, !15, i64 72, !14, i64 96, !14, i64 104, !9, i64 112, !8, i64 8304, !8, i64 8308, !8, i64 8312, !14, i64 8320, !8, i64 8328, !8, i64 8332, !11, i64 8336, !11, i64 8340, !8, i64 8344, !8, i64 8348, !13, i64 8352, !12, i64 8400, !12, i64 8408, !9, i64 8416, !9, i64 8480, !9, i64 8544, !9, i64 8576, !9, i64 9600, !9, i64 10624, !9, i64 11648, !9, i64 11660, !9, i64 11672, !9, i64 11684, !11, i64 11696, !9, i64 11700, !9, i64 11800, !14, i64 134680, !8, i64 134688, !9, i64 134692, !8, i64 138788, !24, i64 138792}
!24 = !{!"bool", !9, i64 0}
!25 = !{!6, !8, i64 504}
!26 = !{!6, !14, i64 512}
!27 = !{!7, !11, i64 68}
!28 = !{!18, !8, i64 8}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30, !32}
!32 = !{!"llvm.loop.unswitch.partial.disable"}
!33 = distinct !{!33, !30}
!34 = distinct !{!34, !30, !32}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass