; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_audio_basics)

; 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.juce::MidiBuffer" = type { %"class.juce::Array" }
%"class.juce::Array" = type { %"class.juce::ArrayAllocationBase", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase" = type <{ %"class.juce::HeapBlock", i32, [4 x i8] }>
%"class.juce::HeapBlock" = type { ptr }
%"struct.juce::MPEZone" = type { i32, i32, i32, i32 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce16MidiRPNGenerator8generateEiiibb(ptr dead_on_unwind noalias writable sret(%"class.juce::MidiBuffer") align 8, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce7MPEZone16getMasterChannelEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce7MPEZone23getMasterPitchbendRangeEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce11MPEMessages20masterPitchbendRangeENS_7MPEZoneE(ptr dead_on_unwind noalias writable sret(%"class.juce::MidiBuffer") align 8 %0, i64 %1, i64 %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.juce::MPEZone", align 4
  store ptr %0, ptr %4, align 8
  %6 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 0
  store i64 %1, ptr %6, align 4
  %7 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 1
  store i64 %2, ptr %7, align 4
  %8 = call noundef i32 @_ZNK4juce7MPEZone16getMasterChannelEv(ptr noundef nonnull align 4 dereferenceable(16) %5) #2
  %9 = call noundef i32 @_ZNK4juce7MPEZone23getMasterPitchbendRangeEv(ptr noundef nonnull align 4 dereferenceable(16) %5) #2
  call void @_ZN4juce16MidiRPNGenerator8generateEiiibb(ptr dead_on_unwind writable sret(%"class.juce::MidiBuffer") align 8 %0, i32 noundef %8, i32 noundef 0, i32 noundef %9, i1 noundef zeroext false, i1 noundef zeroext false)
  ret void
}

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 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 #2 = { 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)"}


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

%"class.juce::MidiBuffer" = type { %"class.juce::Array" }
%"class.juce::Array" = type { %"class.juce::ArrayAllocationBase", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase" = type <{ %"class.juce::HeapBlock", i32, [4 x i8] }>
%"class.juce::HeapBlock" = type { ptr }
%"struct.juce::MPEZone" = type { i32, i32, i32, i32 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce16MidiRPNGenerator8generateEiiibb(ptr dead_on_unwind noalias writable sret(%"class.juce::MidiBuffer") align 8, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce7MPEZone16getMasterChannelEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce7MPEZone23getMasterPitchbendRangeEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce11MPEMessages20masterPitchbendRangeENS_7MPEZoneE(ptr dead_on_unwind noalias writable sret(%"class.juce::MidiBuffer") align 8 %0, i64 %1, i64 %2) local_unnamed_addr #0 align 2 {
  %4 = alloca %"struct.juce::MPEZone", align 8
  store i64 %1, ptr %4, align 8
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %2, ptr %5, align 8
  %6 = call noundef i32 @_ZNK4juce7MPEZone16getMasterChannelEv(ptr noundef nonnull align 4 dereferenceable(16) %4) #2
  %7 = call noundef i32 @_ZNK4juce7MPEZone23getMasterPitchbendRangeEv(ptr noundef nonnull align 4 dereferenceable(16) %4) #2
  call void @_ZN4juce16MidiRPNGenerator8generateEiiibb(ptr dead_on_unwind writable sret(%"class.juce::MidiBuffer") align 8 %0, i32 noundef %6, i32 noundef 0, i32 noundef %7, i1 noundef zeroext false, i1 noundef zeroext false)
  ret void
}

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 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 #2 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InstCombinePass,SROAPass