; LLVM IR from Overload-Technologies/Overload :: Dependencies/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, i32, [256 x float], [256 x float] }
%"class.SoLoud::AudioSource" = type { ptr, i32, float, float, i32, i32, float, float, float, i32, float, [8 x ptr], ptr, ptr, ptr, i32, double }

; 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 %203

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 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 4
  %56 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !26
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 9
  %60 = load float, ptr %59, align 4, !tbaa !27
  %61 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 10
  %62 = load i32, ptr %61, align 8, !tbaa !21
  %63 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = getelementptr inbounds %"class.SoLoud::Bus", ptr %64, i32 0, i32 3
  %66 = load i32, ptr %65, align 4, !tbaa !28
  call void @_ZN6SoLoud6Soloud15mixBus_internalEPfjjS1_jfjj(ptr noundef nonnull align 8 dereferenceable(138833) %51, ptr noundef %52, i32 noundef %53, i32 noundef %54, ptr noundef %57, i32 noundef %58, float noundef %60, i32 noundef %62, i32 noundef %66)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %67 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %69 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 8, !tbaa !29
  %71 = and i32 %70, 4
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %201

73:                                               ; preds = %46
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %82, %73
  %75 = load i32, ptr %14, align 4, !tbaa !9
  %76 = icmp slt i32 %75, 8
  br i1 %76, label %77, label %85

77:                                               ; preds = %74
  %78 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %79 = load i32, ptr %14, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [8 x float], ptr %78, i64 0, i64 %80
  store float 0.000000e+00, ptr %81, align 4, !tbaa !22
  br label %82

82:                                               ; preds = %77
  %83 = load i32, ptr %14, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %14, align 4, !tbaa !9
  br label %74, !llvm.loop !30

85:                                               ; preds = %74
  %86 = load i32, ptr %8, align 4, !tbaa !9
  %87 = icmp ugt i32 %86, 255
  br i1 %87, label %88, label %143

88:                                               ; preds = %85
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %139, %88
  %90 = load i32, ptr %14, align 4, !tbaa !9
  %91 = icmp slt i32 %90, 256
  br i1 %91, label %92, label %142

92:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %93 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 6
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [256 x float], ptr %93, i64 0, i64 %95
  store float 0.000000e+00, ptr %96, align 4, !tbaa !22
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %135, %92
  %98 = load i32, ptr %15, align 4, !tbaa !9
  %99 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 10
  %100 = load i32, ptr %99, align 8, !tbaa !21
  %101 = icmp slt i32 %98, %100
  br i1 %101, label %102, label %138

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = load i32, ptr %14, align 4, !tbaa !9
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = load i32, ptr %15, align 4, !tbaa !9
  %107 = mul i32 %105, %106
  %108 = add i32 %104, %107
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds float, ptr %103, i64 %109
  %111 = load float, ptr %110, align 4, !tbaa !22
  store float %111, ptr %16, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %112 = load float, ptr %16, align 4, !tbaa !22
  %113 = call noundef float @_ZSt4fabsf(float noundef %112)
  store float %113, ptr %17, align 4, !tbaa !22
  %114 = load float, ptr %17, align 4, !tbaa !22
  %115 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [8 x float], ptr %115, i64 0, i64 %117
  %119 = load float, ptr %118, align 4, !tbaa !22
  %120 = fcmp ogt float %114, %119
  br i1 %120, label %121, label %127

121:                                              ; preds = %102
  %122 = load float, ptr %17, align 4, !tbaa !22
  %123 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %124 = load i32, ptr %15, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [8 x float], ptr %123, i64 0, i64 %125
  store float %122, ptr %126, align 4, !tbaa !22
  br label %127

127:                                              ; preds = %121, %102
  %128 = load float, ptr %16, align 4, !tbaa !22
  %129 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 6
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [256 x float], ptr %129, i64 0, i64 %131
  %133 = load float, ptr %132, align 4, !tbaa !22
  %134 = fadd float %133, %128
  store float %134, ptr %132, 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 %135

135:                                              ; preds = %127
  %136 = load i32, ptr %15, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %15, align 4, !tbaa !9
  br label %97, !llvm.loop !31

138:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %14, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %14, align 4, !tbaa !9
  br label %89, !llvm.loop !32

142:                                              ; preds = %89
  br label %200

143:                                              ; preds = %85
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %196, %143
  %145 = load i32, ptr %14, align 4, !tbaa !9
  %146 = icmp slt i32 %145, 256
  br i1 %146, label %147, label %199

147:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %148 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 6
  %149 = load i32, ptr %14, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [256 x float], ptr %148, i64 0, i64 %150
  store float 0.000000e+00, ptr %151, align 4, !tbaa !22
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %152

152:                                              ; preds = %192, %147
  %153 = load i32, ptr %18, align 4, !tbaa !9
  %154 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %21, i32 0, i32 10
  %155 = load i32, ptr %154, align 8, !tbaa !21
  %156 = icmp slt i32 %153, %155
  br i1 %156, label %157, label %195

157:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = load i32, ptr %14, align 4, !tbaa !9
  %160 = load i32, ptr %8, align 4, !tbaa !9
  %161 = urem i32 %159, %160
  %162 = load i32, ptr %9, align 4, !tbaa !9
  %163 = load i32, ptr %18, align 4, !tbaa !9
  %164 = mul i32 %162, %163
  %165 = add i32 %161, %164
  %166 = zext i32 %165 to i64
  %167 = getelementptr inbounds float, ptr %158, i64 %166
  %168 = load float, ptr %167, align 4, !tbaa !22
  store float %168, ptr %19, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %169 = load float, ptr %19, align 4, !tbaa !22
  %170 = call noundef float @_ZSt4fabsf(float noundef %169)
  store float %170, ptr %20, align 4, !tbaa !22
  %171 = load float, ptr %20, align 4, !tbaa !22
  %172 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %173 = load i32, ptr %18, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [8 x float], ptr %172, i64 0, i64 %174
  %176 = load float, ptr %175, align 4, !tbaa !22
  %177 = fcmp ogt float %171, %176
  br i1 %177, label %178, label %184

178:                                              ; preds = %157
  %179 = load float, ptr %20, align 4, !tbaa !22
  %180 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 5
  %181 = load i32, ptr %18, align 4, !tbaa !9
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [8 x float], ptr %180, i64 0, i64 %182
  store float %179, ptr %183, align 4, !tbaa !22
  br label %184

184:                                              ; preds = %178, %157
  %185 = load float, ptr %19, align 4, !tbaa !22
  %186 = getelementptr inbounds %"class.SoLoud::BusInstance", ptr %21, i32 0, i32 6
  %187 = load i32, ptr %14, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [256 x float], ptr %186, i64 0, i64 %188
  %190 = load float, ptr %189, align 4, !tbaa !22
  %191 = fadd float %190, %185
  store float %191, ptr %189, 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 %192

192:                                              ; preds = %184
  %193 = load i32, ptr %18, align 4, !tbaa !9
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %18, align 4, !tbaa !9
  br label %152, !llvm.loop !33

195:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %14, align 4, !tbaa !9
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %14, align 4, !tbaa !9
  br label %144, !llvm.loop !34

199:                                              ; preds = %144
  br label %200

200:                                              ; preds = %199, %142
  br label %201

201:                                              ; preds = %200, %46
  %202 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %202, 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 %203

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

declare void @_ZN6SoLoud6Soloud15mixBus_internalEPfjjS1_jfjj(ptr noundef nonnull align 8 dereferenceable(138833), ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, i32 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, !10, i64 164, !7, i64 168, !7, i64 1192}
!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 = !{!12, !6, i64 512}
!27 = !{!13, !14, i64 68}
!28 = !{!19, !10, i64 164}
!29 = !{!20, !10, i64 8}
!30 = distinct !{!30, !24}
!31 = distinct !{!31, !24}
!32 = distinct !{!32, !24}
!33 = distinct !{!33, !24}
!34 = distinct !{!34, !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 nocapture 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
  %.not73 = icmp eq i32 %12, 0
  br i1 %.not73, label %.loopexit, label %.lr.ph72.preheader

.lr.ph72.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 %0, i64 512
  %19 = load ptr, ptr %18, align 8, !tbaa !22
  %20 = getelementptr inbounds i8, ptr %0, i64 68
  %21 = load float, ptr %20, align 4, !tbaa !23
  %22 = getelementptr inbounds i8, ptr %0, i64 72
  %23 = load i32, ptr %22, align 8, !tbaa !19
  %24 = getelementptr inbounds i8, ptr %6, i64 164
  %25 = load i32, ptr %24, align 4, !tbaa !24
  tail call void @_ZN6SoLoud6Soloud15mixBus_internalEPfjjS1_jfjj(ptr noundef nonnull align 8 dereferenceable(138833) %17, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %19, i32 noundef %8, float noundef %21, i32 noundef %23, i32 noundef %25)
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !25
  %29 = and i32 %28, 4
  %.not = icmp eq i32 %29, 0
  br i1 %.not, label %.loopexit, label %.preheader62

.preheader62:                                     ; preds = %15
  %30 = getelementptr inbounds i8, ptr %0, i64 536
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %30, i8 0, i64 32, i1 false), !tbaa !20
  %31 = icmp ugt i32 %2, 255
  %32 = getelementptr inbounds i8, ptr %0, i64 568
  %33 = load i32, ptr %22, align 8, !tbaa !19
  %34 = icmp sgt i32 %33, 0
  br i1 %31, label %.preheader58, label %.preheader60

.preheader60:                                     ; preds = %.preheader62
  br i1 %34, label %.preheader60.split, label %.preheader60.split.us.preheader

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

.preheader58:                                     ; preds = %.preheader62
  br i1 %34, label %.preheader58.split, label %.preheader58.split.us.preheader

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

.preheader58.split:                               ; preds = %.preheader58, %._crit_edge69
  %35 = phi i32 [ %56, %._crit_edge69 ], [ %33, %.preheader58 ]
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %._crit_edge69 ], [ 0, %.preheader58 ]
  %36 = getelementptr inbounds [256 x float], ptr %32, i64 0, i64 %indvars.iv90
  store float 0.000000e+00, ptr %36, align 4, !tbaa !20
  %37 = icmp sgt i32 %35, 0
  br i1 %37, label %.lr.ph68.preheader, label %._crit_edge69

.lr.ph68.preheader:                               ; preds = %.preheader58.split
  %38 = trunc nuw nsw i64 %indvars.iv90 to i32
  br label %.lr.ph68

.lr.ph68:                                         ; preds = %.lr.ph68.preheader, %50
  %indvars.iv87 = phi i64 [ 0, %.lr.ph68.preheader ], [ %indvars.iv.next88, %50 ]
  %39 = trunc nuw nsw i64 %indvars.iv87 to i32
  %40 = mul i32 %39, %3
  %41 = add i32 %40, %38
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds float, ptr %1, i64 %42
  %44 = load float, ptr %43, align 4, !tbaa !20
  %45 = tail call noundef float @_ZSt4fabsf(float noundef %44)
  %46 = getelementptr inbounds [8 x float], ptr %30, i64 0, i64 %indvars.iv87
  %47 = load float, ptr %46, align 4, !tbaa !20
  %48 = fcmp ogt float %45, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %.lr.ph68
  store float %45, ptr %46, align 4, !tbaa !20
  br label %50

50:                                               ; preds = %49, %.lr.ph68
  %51 = load float, ptr %36, align 4, !tbaa !20
  %52 = fadd float %44, %51
  store float %52, ptr %36, align 4, !tbaa !20
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %53 = load i32, ptr %22, align 8, !tbaa !19
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next88, %54
  br i1 %55, label %.lr.ph68, label %._crit_edge69, !llvm.loop !26

._crit_edge69:                                    ; preds = %50, %.preheader58.split
  %56 = phi i32 [ %35, %.preheader58.split ], [ %53, %50 ]
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next91, 256
  br i1 %exitcond93.not, label %.loopexit, label %.preheader58.split, !llvm.loop !28

.preheader60.split:                               ; preds = %.preheader60, %._crit_edge
  %57 = phi i32 [ %80, %._crit_edge ], [ %33, %.preheader60 ]
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %._crit_edge ], [ 0, %.preheader60 ]
  %58 = getelementptr inbounds [256 x float], ptr %32, i64 0, i64 %indvars.iv81
  store float 0.000000e+00, ptr %58, align 4, !tbaa !20
  %59 = icmp sgt i32 %57, 0
  br i1 %59, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader60.split
  %60 = trunc nuw nsw i64 %indvars.iv81 to i32
  %61 = urem i32 %60, %2
  br label %62

62:                                               ; preds = %.lr.ph, %74
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %74 ]
  %63 = trunc nuw nsw i64 %indvars.iv to i32
  %64 = mul i32 %63, %3
  %65 = add i32 %61, %64
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds float, ptr %1, i64 %66
  %68 = load float, ptr %67, align 4, !tbaa !20
  %69 = tail call noundef float @_ZSt4fabsf(float noundef %68)
  %70 = getelementptr inbounds [8 x float], ptr %30, i64 0, i64 %indvars.iv
  %71 = load float, ptr %70, align 4, !tbaa !20
  %72 = fcmp ogt float %69, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %62
  store float %69, ptr %70, align 4, !tbaa !20
  br label %74

74:                                               ; preds = %73, %62
  %75 = load float, ptr %58, align 4, !tbaa !20
  %76 = fadd float %68, %75
  store float %76, ptr %58, align 4, !tbaa !20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %77 = load i32, ptr %22, align 8, !tbaa !19
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next, %78
  br i1 %79, label %62, label %._crit_edge, !llvm.loop !30

._crit_edge:                                      ; preds = %74, %.preheader60.split
  %80 = phi i32 [ %57, %.preheader60.split ], [ %77, %74 ]
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next82, 256
  br i1 %exitcond.not, label %.loopexit, label %.preheader60.split, !llvm.loop !31

.loopexit:                                        ; preds = %._crit_edge, %._crit_edge69, %.preheader60.split.us.preheader, %.preheader58.split.us.preheader, %.lr.ph72.preheader, %.preheader, %15
  ret i32 %2
}

declare void @_ZN6SoLoud6Soloud15mixBus_internalEPfjjS1_jfjj(ptr noundef nonnull align 8 dereferenceable(138833), ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, i32 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, !8, i64 164, !9, i64 168, !9, i64 1192}
!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 = !{!6, !14, i64 512}
!23 = !{!7, !11, i64 68}
!24 = !{!17, !8, i64 164}
!25 = !{!18, !8, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27, !29}
!29 = !{!"llvm.loop.unswitch.partial.disable"}
!30 = distinct !{!30, !27}
!31 = distinct !{!31, !27, !29}


; 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