; LLVM IR from kdrag0n/fxdsp :: external/oboe/apps/OboeTester/app/src/main/cpp/flowunits (OscillatorBase)

; 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.OscillatorBase = type <{ %"class.oboe::flowgraph::FlowGraphNode", %"class.oboe::flowgraph::FlowGraphPortFloatInput", %"class.oboe::flowgraph::FlowGraphPortFloatInput", %"class.oboe::flowgraph::FlowGraphPortFloatOutput", float, float, float, [4 x i8] }>
%"class.oboe::flowgraph::FlowGraphNode" = type { ptr, i64, %"class.std::vector", i8, i8, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::reference_wrapper<oboe::flowgraph::FlowGraphPort>, std::allocator<std::reference_wrapper<oboe::flowgraph::FlowGraphPort>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::reference_wrapper<oboe::flowgraph::FlowGraphPort>, std::allocator<std::reference_wrapper<oboe::flowgraph::FlowGraphPort>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::reference_wrapper<oboe::flowgraph::FlowGraphPort>, std::allocator<std::reference_wrapper<oboe::flowgraph::FlowGraphPort>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::reference_wrapper<oboe::flowgraph::FlowGraphPort>, std::allocator<std::reference_wrapper<oboe::flowgraph::FlowGraphPort>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.oboe::flowgraph::FlowGraphPortFloatInput" = type { %"class.oboe::flowgraph::FlowGraphPortFloat", ptr }
%"class.oboe::flowgraph::FlowGraphPortFloat" = type { %"class.oboe::flowgraph::FlowGraphPort.base", i32, %"class.std::unique_ptr" }
%"class.oboe::flowgraph::FlowGraphPort.base" = type <{ ptr, ptr, i32 }>
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.oboe::flowgraph::FlowGraphPortFloatOutput" = type { %"class.oboe::flowgraph::FlowGraphPortFloat" }

@_ZTV14OscillatorBase = external dso_local unnamed_addr constant { [7 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14OscillatorBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(172) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @_ZN4oboe9flowgraph13FlowGraphNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5)
  store ptr getelementptr inbounds inrange(-16, 40) ({ [7 x ptr] }, ptr @_ZTV14OscillatorBase, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %class.OscillatorBase, ptr %5, i32 0, i32 1
  invoke void @_ZN4oboe9flowgraph23FlowGraphPortFloatInputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull align 8 dereferenceable(48) %5, i32 noundef 1)
          to label %7 unwind label %16

7:                                                ; preds = %1
  %8 = getelementptr inbounds %class.OscillatorBase, ptr %5, i32 0, i32 2
  invoke void @_ZN4oboe9flowgraph23FlowGraphPortFloatInputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(48) %5, i32 noundef 1)
          to label %9 unwind label %20

9:                                                ; preds = %7
  %10 = getelementptr inbounds %class.OscillatorBase, ptr %5, i32 0, i32 3
  invoke void @_ZN4oboe9flowgraph24FlowGraphPortFloatOutputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(48) %5, i32 noundef 1)
          to label %11 unwind label %24

11:                                               ; preds = %9
  %12 = getelementptr inbounds %class.OscillatorBase, ptr %5, i32 0, i32 4
  store float 0.000000e+00, ptr %12, align 8, !tbaa !11
  %13 = getelementptr inbounds %class.OscillatorBase, ptr %5, i32 0, i32 5
  store float 0.000000e+00, ptr %13, align 4, !tbaa !32
  %14 = getelementptr inbounds %class.OscillatorBase, ptr %5, i32 0, i32 6
  store float 0.000000e+00, ptr %14, align 8, !tbaa !33
  invoke void @_ZN14OscillatorBase13setSampleRateEf(ptr noundef nonnull align 8 dereferenceable(172) %5, float noundef 4.800000e+04)
          to label %15 unwind label %28

15:                                               ; preds = %11
  ret void

16:                                               ; preds = %1
  %17 = landingpad { ptr, i32 }
          cleanup
  %18 = extractvalue { ptr, i32 } %17, 0
  store ptr %18, ptr %3, align 8
  %19 = extractvalue { ptr, i32 } %17, 1
  store i32 %19, ptr %4, align 4
  br label %34

20:                                               ; preds = %7
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %3, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %4, align 4
  br label %33

24:                                               ; preds = %9
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %3, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %4, align 4
  br label %32

28:                                               ; preds = %11
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %3, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %4, align 4
  call void @_ZN4oboe9flowgraph18FlowGraphPortFloatD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #2
  br label %32

32:                                               ; preds = %28, %24
  call void @_ZN4oboe9flowgraph18FlowGraphPortFloatD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #2
  br label %33

33:                                               ; preds = %32, %20
  call void @_ZN4oboe9flowgraph18FlowGraphPortFloatD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #2
  br label %34

34:                                               ; preds = %33, %16
  call void @_ZN4oboe9flowgraph13FlowGraphNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #2
  br label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr %3, align 8
  %37 = load i32, ptr %4, align 4
  %38 = insertvalue { ptr, i32 } poison, ptr %36, 0
  %39 = insertvalue { ptr, i32 } %38, i32 %37, 1
  resume { ptr, i32 } %39
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4oboe9flowgraph13FlowGraphNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4oboe9flowgraph23FlowGraphPortFloatInputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4oboe9flowgraph24FlowGraphPortFloatOutputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14OscillatorBase13setSampleRateEf(ptr noundef nonnull align 8 dereferenceable(172), float noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4oboe9flowgraph18FlowGraphPortFloatD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4oboe9flowgraph13FlowGraphNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

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)"}
!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, !31, i64 160}
!12 = !{!"_ZTS14OscillatorBase", !13, i64 0, !21, i64 48, !21, i64 88, !30, i64 128, !31, i64 160, !31, i64 164, !31, i64 168}
!13 = !{!"_ZTSN4oboe9flowgraph13FlowGraphNodeE", !14, i64 8, !15, i64 16, !19, i64 40, !19, i64 41, !20, i64 44}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSSt6vectorISt17reference_wrapperIN4oboe9flowgraph13FlowGraphPortEESaIS4_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseISt17reference_wrapperIN4oboe9flowgraph13FlowGraphPortEESaIS4_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt17reference_wrapperIN4oboe9flowgraph13FlowGraphPortEESaIS4_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt17reference_wrapperIN4oboe9flowgraph13FlowGraphPortEESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTSN4oboe9flowgraph23FlowGraphPortFloatInputE", !22, i64 0, !6, i64 32}
!22 = !{!"_ZTSN4oboe9flowgraph18FlowGraphPortFloatE", !23, i64 0, !20, i64 20, !24, i64 24}
!23 = !{!"_ZTSN4oboe9flowgraph13FlowGraphPortE", !6, i64 8, !20, i64 16}
!24 = !{!"_ZTSSt10unique_ptrIA_fSt14default_deleteIS0_EE", !25, i64 0}
!25 = !{!"_ZTSSt15__uniq_ptr_dataIfSt14default_deleteIA_fELb1ELb1EE", !26, i64 0}
!26 = !{!"_ZTSSt15__uniq_ptr_implIfSt14default_deleteIA_fEE", !27, i64 0}
!27 = !{!"_ZTSSt5tupleIJPfSt14default_deleteIA_fEEE", !28, i64 0}
!28 = !{!"_ZTSSt11_Tuple_implILm0EJPfSt14default_deleteIA_fEEE", !29, i64 0}
!29 = !{!"_ZTSSt10_Head_baseILm0EPfLb0EE", !6, i64 0}
!30 = !{!"_ZTSN4oboe9flowgraph24FlowGraphPortFloatOutputE", !22, i64 0}
!31 = !{!"float", !7, i64 0}
!32 = !{!12, !31, i64 164}
!33 = !{!12, !31, i64 168}


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

@_ZTV14OscillatorBase = external dso_local unnamed_addr constant { [7 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14OscillatorBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(172) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN4oboe9flowgraph13FlowGraphNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0)
  store ptr getelementptr inbounds inrange(-16, 40) (i8, ptr @_ZTV14OscillatorBase, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 48
  invoke void @_ZN4oboe9flowgraph23FlowGraphPortFloatInputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef 1)
          to label %3 unwind label %10

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  invoke void @_ZN4oboe9flowgraph23FlowGraphPortFloatInputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef 1)
          to label %5 unwind label %12

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 128
  invoke void @_ZN4oboe9flowgraph24FlowGraphPortFloatOutputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef 1)
          to label %7 unwind label %14

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %0, i64 160
  store <2 x float> zeroinitializer, ptr %8, align 8, !tbaa !8
  %9 = getelementptr inbounds i8, ptr %0, i64 168
  store float 0.000000e+00, ptr %9, align 8, !tbaa !11
  tail call void @_ZN14OscillatorBase13setSampleRateEf(ptr noundef nonnull align 8 dereferenceable(172) %0, float noundef 4.800000e+04)
  ret void

10:                                               ; preds = %1
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %17

12:                                               ; preds = %3
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %16

14:                                               ; preds = %5
  %15 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN4oboe9flowgraph18FlowGraphPortFloatD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #2
  br label %16

16:                                               ; preds = %14, %12
  %.pn = phi { ptr, i32 } [ %15, %14 ], [ %13, %12 ]
  tail call void @_ZN4oboe9flowgraph18FlowGraphPortFloatD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #2
  br label %17

17:                                               ; preds = %16, %10
  %.pn.pn = phi { ptr, i32 } [ %.pn, %16 ], [ %11, %10 ]
  tail call void @_ZN4oboe9flowgraph13FlowGraphNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #2
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4oboe9flowgraph13FlowGraphNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4oboe9flowgraph23FlowGraphPortFloatInputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4oboe9flowgraph24FlowGraphPortFloatOutputC2ERNS0_13FlowGraphNodeEi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14OscillatorBase13setSampleRateEf(ptr noundef nonnull align 8 dereferenceable(172), float noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4oboe9flowgraph18FlowGraphPortFloatD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4oboe9flowgraph13FlowGraphNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 168}
!12 = !{!"_ZTS14OscillatorBase", !13, i64 0, !22, i64 48, !22, i64 88, !31, i64 128, !9, i64 160, !9, i64 164, !9, i64 168}
!13 = !{!"_ZTSN4oboe9flowgraph13FlowGraphNodeE", !14, i64 8, !15, i64 16, !20, i64 40, !20, i64 41, !21, i64 44}
!14 = !{!"long", !10, i64 0}
!15 = !{!"_ZTSSt6vectorISt17reference_wrapperIN4oboe9flowgraph13FlowGraphPortEESaIS4_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseISt17reference_wrapperIN4oboe9flowgraph13FlowGraphPortEESaIS4_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt17reference_wrapperIN4oboe9flowgraph13FlowGraphPortEESaIS4_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt17reference_wrapperIN4oboe9flowgraph13FlowGraphPortEESaIS4_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !10, i64 0}
!20 = !{!"bool", !10, i64 0}
!21 = !{!"int", !10, i64 0}
!22 = !{!"_ZTSN4oboe9flowgraph23FlowGraphPortFloatInputE", !23, i64 0, !19, i64 32}
!23 = !{!"_ZTSN4oboe9flowgraph18FlowGraphPortFloatE", !24, i64 0, !21, i64 20, !25, i64 24}
!24 = !{!"_ZTSN4oboe9flowgraph13FlowGraphPortE", !19, i64 8, !21, i64 16}
!25 = !{!"_ZTSSt10unique_ptrIA_fSt14default_deleteIS0_EE", !26, i64 0}
!26 = !{!"_ZTSSt15__uniq_ptr_dataIfSt14default_deleteIA_fELb1ELb1EE", !27, i64 0}
!27 = !{!"_ZTSSt15__uniq_ptr_implIfSt14default_deleteIA_fEE", !28, i64 0}
!28 = !{!"_ZTSSt5tupleIJPfSt14default_deleteIA_fEEE", !29, i64 0}
!29 = !{!"_ZTSSt11_Tuple_implILm0EJPfSt14default_deleteIA_fEEE", !30, i64 0}
!30 = !{!"_ZTSSt10_Head_baseILm0EPfLb0EE", !19, i64 0}
!31 = !{!"_ZTSN4oboe9flowgraph24FlowGraphPortFloatOutputE", !23, i64 0}


; Effective O3 passes: GlobalOptPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass