; LLVM IR from kdrag0n/fxdsp :: sinks/oboe.ll (ZN5fxdsp8OboeSink11write_audioERSt6vectorIS1_IfSaIfEESaIS3_EE)

; 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.oboe::ResultWithValue" = type { i32, i32 }
%"class.fxdsp::OboeSink" = type { %"class.fxdsp::AudioSink", %"class.std::shared_ptr", %"class.oboe::AudioStreamBuilder", %"class.std::vector.3", i32, i32 }
%"class.fxdsp::AudioSink" = type { ptr, %"class.std::vector", i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.oboe::AudioStreamBuilder" = type <{ %"class.oboe::AudioStreamBase", i32, [4 x i8] }>
%"class.oboe::AudioStreamBase" = type { ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i8, i8, i32 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIN4oboe11AudioStreamEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16), ptr) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5fxdsp8OboeSink11write_audioERSt6vectorIS1_IfSaIfEESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %"class.oboe::ResultWithValue", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IfSaIfEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #4
  %15 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  store i64 %15, ptr %5, align 8, !tbaa !9
  %16 = getelementptr inbounds %"class.fxdsp::OboeSink", ptr %12, i32 0, i32 3
  %17 = load i64, ptr %5, align 8, !tbaa !9
  %18 = getelementptr inbounds %"class.fxdsp::AudioSink", ptr %12, i32 0, i32 3
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = sext i32 %19 to i64
  %21 = mul i64 %17, %20
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !19
  br label %22

22:                                               ; preds = %58, %2
  %23 = load i32, ptr %6, align 4, !tbaa !19
  %24 = getelementptr inbounds %"class.fxdsp::AudioSink", ptr %12, i32 0, i32 3
  %25 = load i32, ptr %24, align 4, !tbaa !11
  %26 = icmp slt i32 %23, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %61

28:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !19
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IfSaIfEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %31) #4
  store ptr %32, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !19
  br label %33

33:                                               ; preds = %54, %28
  %34 = load i32, ptr %9, align 4, !tbaa !19
  %35 = sext i32 %34 to i64
  %36 = load i64, ptr %5, align 8, !tbaa !9
  %37 = icmp ult i64 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %57

39:                                               ; preds = %33
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !19
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %42) #4
  %44 = load float, ptr %43, align 4, !tbaa !20
  %45 = getelementptr inbounds %"class.fxdsp::OboeSink", ptr %12, i32 0, i32 3
  %46 = load i32, ptr %9, align 4, !tbaa !19
  %47 = getelementptr inbounds %"class.fxdsp::AudioSink", ptr %12, i32 0, i32 3
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = mul nsw i32 %46, %48
  %50 = load i32, ptr %6, align 4, !tbaa !19
  %51 = add nsw i32 %49, %50
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %52) #4
  store float %44, ptr %53, align 4, !tbaa !20
  br label %54

54:                                               ; preds = %39
  %55 = load i32, ptr %9, align 4, !tbaa !19
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %9, align 4, !tbaa !19
  br label %33, !llvm.loop !22

57:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %6, align 4, !tbaa !19
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %6, align 4, !tbaa !19
  br label %22, !llvm.loop !24

61:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %62 = load i64, ptr %5, align 8, !tbaa !9
  %63 = mul i64 %62, 4
  %64 = getelementptr inbounds %"class.fxdsp::AudioSink", ptr %12, i32 0, i32 3
  %65 = load i32, ptr %64, align 4, !tbaa !11
  %66 = sext i32 %65 to i64
  %67 = mul i64 %63, %66
  store i64 %67, ptr %10, align 8, !tbaa !9
  %68 = getelementptr inbounds %"class.fxdsp::OboeSink", ptr %12, i32 0, i32 1
  %69 = call noundef zeroext i1 @_ZStneIN4oboe11AudioStreamEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %68, ptr null) #4
  br i1 %69, label %70, label %84

70:                                               ; preds = %61
  %71 = getelementptr inbounds %"class.fxdsp::OboeSink", ptr %12, i32 0, i32 1
  %72 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4oboe11AudioStreamELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %71) #4
  %73 = getelementptr inbounds %"class.fxdsp::OboeSink", ptr %12, i32 0, i32 3
  %74 = call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #4
  %75 = load i64, ptr %10, align 8, !tbaa !9
  %76 = trunc i64 %75 to i32
  %77 = getelementptr inbounds %"class.fxdsp::OboeSink", ptr %12, i32 0, i32 4
  %78 = load i32, ptr %77, align 8, !tbaa !25
  %79 = sdiv i32 %76, %78
  %80 = load ptr, ptr %72, align 8, !tbaa !49
  %81 = getelementptr inbounds ptr, ptr %80, i64 25
  %82 = load ptr, ptr %81, align 8
  %83 = call i64 %82(ptr noundef nonnull align 8 dereferenceable(238) %72, ptr noundef %74, i32 noundef %79, i64 noundef 0)
  store i64 %83, ptr %11, align 4
  br label %84

84:                                               ; preds = %70, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IfSaIfEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #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 = !{!"long", !7, i64 0}
!11 = !{!12, !18, i64 36}
!12 = !{!"_ZTSN5fxdsp9AudioSinkE", !13, i64 8, !17, i64 32, !18, i64 36}
!13 = !{!"_ZTSSt6vectorIS_IfSaIfEESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSN5fxdsp11AudioFormatE", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!18, !18, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!26, !18, i64 240}
!26 = !{!"_ZTSN5fxdsp8OboeSinkE", !12, i64 0, !27, i64 40, !30, i64 56, !45, i64 216, !18, i64 240, !18, i64 244}
!27 = !{!"_ZTSSt10shared_ptrIN4oboe11AudioStreamEE", !28, i64 0}
!28 = !{!"_ZTSSt12__shared_ptrIN4oboe11AudioStreamELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !29, i64 8}
!29 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!30 = !{!"_ZTSN4oboe18AudioStreamBuilderE", !31, i64 0, !44, i64 152}
!31 = !{!"_ZTSN4oboe15AudioStreamBaseE", !6, i64 8, !6, i64 16, !18, i64 24, !18, i64 28, !18, i64 32, !18, i64 36, !18, i64 40, !18, i64 44, !32, i64 48, !33, i64 52, !34, i64 56, !35, i64 60, !36, i64 64, !37, i64 68, !38, i64 72, !39, i64 76, !40, i64 80, !40, i64 112, !42, i64 144, !42, i64 145, !43, i64 148}
!32 = !{!"_ZTSN4oboe11SharingModeE", !7, i64 0}
!33 = !{!"_ZTSN4oboe11AudioFormatE", !7, i64 0}
!34 = !{!"_ZTSN4oboe9DirectionE", !7, i64 0}
!35 = !{!"_ZTSN4oboe15PerformanceModeE", !7, i64 0}
!36 = !{!"_ZTSN4oboe5UsageE", !7, i64 0}
!37 = !{!"_ZTSN4oboe11ContentTypeE", !7, i64 0}
!38 = !{!"_ZTSN4oboe11InputPresetE", !7, i64 0}
!39 = !{!"_ZTSN4oboe9SessionIdE", !7, i64 0}
!40 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !41, i64 0, !10, i64 8, !7, i64 16}
!41 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!42 = !{!"bool", !7, i64 0}
!43 = !{!"_ZTSN4oboe27SampleRateConversionQualityE", !7, i64 0}
!44 = !{!"_ZTSN4oboe8AudioApiE", !7, i64 0}
!45 = !{!"_ZTSSt6vectorIfSaIfEE", !46, i64 0}
!46 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!49 = !{!50, !50, i64 0}
!50 = !{!"vtable pointer", !8, i64 0}


; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN4oboe11AudioStreamELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIN4oboe11AudioStreamEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16), ptr) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5fxdsp8OboeSink11write_audioERSt6vectorIS1_IfSaIfEESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #2 align 2 {
  %3 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IfSaIfEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #3
  %4 = tail call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 216
  %6 = getelementptr inbounds i8, ptr %0, i64 36
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = mul i64 %4, %8
  tail call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %9)
  %10 = load i32, ptr %6, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph21, label %._crit_edge22

.lr.ph21:                                         ; preds = %2
  %.not = icmp eq i64 %4, 0
  br i1 %.not, label %.lr.ph21.split, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph21, %._crit_edge.us
  %indvars.iv27 = phi i64 [ %indvars.iv.next28, %._crit_edge.us ], [ 0, %.lr.ph21 ]
  %12 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IfSaIfEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv27) #3
  %13 = trunc nuw nsw i64 %indvars.iv27 to i32
  br label %14

14:                                               ; preds = %.lr.ph.us, %14
  %indvars.iv = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next, %14 ]
  %15 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %indvars.iv) #3
  %16 = load float, ptr %15, align 4, !tbaa !16
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = trunc nuw nsw i64 %indvars.iv to i32
  %19 = mul nsw i32 %17, %18
  %20 = add nsw i32 %19, %13
  %21 = sext i32 %20 to i64
  %22 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %21) #3
  store float %16, ptr %22, align 4, !tbaa !16
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %4
  br i1 %exitcond.not, label %._crit_edge.us, label %14, !llvm.loop !18

._crit_edge.us:                                   ; preds = %14
  %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next28, %24
  br i1 %25, label %.lr.ph.us, label %._crit_edge22, !llvm.loop !20

._crit_edge22:                                    ; preds = %._crit_edge.us, %.lr.ph21.split, %2
  %.lcssa = phi i32 [ %10, %2 ], [ %29, %.lr.ph21.split ], [ %23, %._crit_edge.us ]
  %26 = getelementptr inbounds i8, ptr %0, i64 40
  %27 = tail call noundef zeroext i1 @_ZStneIN4oboe11AudioStreamEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr null) #3
  br i1 %27, label %32, label %44

.lr.ph21.split:                                   ; preds = %.lr.ph21, %.lr.ph21.split
  %indvars.iv30 = phi i64 [ %indvars.iv.next31, %.lr.ph21.split ], [ 0, %.lr.ph21 ]
  %28 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IfSaIfEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv30) #3
  %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next31, %30
  br i1 %31, label %.lr.ph21.split, label %._crit_edge22, !llvm.loop !20

32:                                               ; preds = %._crit_edge22
  %33 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN4oboe11AudioStreamELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %26) #3
  %34 = tail call noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  %.tr = trunc i64 %4 to i32
  %35 = shl i32 %.tr, 2
  %36 = mul i32 %35, %.lcssa
  %37 = getelementptr inbounds i8, ptr %0, i64 240
  %38 = load i32, ptr %37, align 8, !tbaa !21
  %39 = sdiv i32 %36, %38
  %40 = load ptr, ptr %33, align 8, !tbaa !46
  %41 = getelementptr inbounds i8, ptr %40, i64 200
  %42 = load ptr, ptr %41, align 8
  %43 = tail call i64 %42(ptr noundef nonnull align 8 dereferenceable(238) %33, ptr noundef %34, i32 noundef %39, i64 noundef 0)
  br label %44

44:                                               ; preds = %32, %._crit_edge22
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IfSaIfEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { 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, !15, i64 36}
!6 = !{!"_ZTSN5fxdsp9AudioSinkE", !7, i64 8, !14, i64 32, !15, i64 36}
!7 = !{!"_ZTSSt6vectorIS_IfSaIfEESaIS1_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSN5fxdsp11AudioFormatE", !12, i64 0}
!15 = !{!"int", !12, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !12, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!22, !15, i64 240}
!22 = !{!"_ZTSN5fxdsp8OboeSinkE", !6, i64 0, !23, i64 40, !26, i64 56, !42, i64 216, !15, i64 240, !15, i64 244}
!23 = !{!"_ZTSSt10shared_ptrIN4oboe11AudioStreamEE", !24, i64 0}
!24 = !{!"_ZTSSt12__shared_ptrIN4oboe11AudioStreamELN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0, !25, i64 8}
!25 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0}
!26 = !{!"_ZTSN4oboe18AudioStreamBuilderE", !27, i64 0, !41, i64 152}
!27 = !{!"_ZTSN4oboe15AudioStreamBaseE", !11, i64 8, !11, i64 16, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !28, i64 48, !29, i64 52, !30, i64 56, !31, i64 60, !32, i64 64, !33, i64 68, !34, i64 72, !35, i64 76, !36, i64 80, !36, i64 112, !39, i64 144, !39, i64 145, !40, i64 148}
!28 = !{!"_ZTSN4oboe11SharingModeE", !12, i64 0}
!29 = !{!"_ZTSN4oboe11AudioFormatE", !12, i64 0}
!30 = !{!"_ZTSN4oboe9DirectionE", !12, i64 0}
!31 = !{!"_ZTSN4oboe15PerformanceModeE", !12, i64 0}
!32 = !{!"_ZTSN4oboe5UsageE", !12, i64 0}
!33 = !{!"_ZTSN4oboe11ContentTypeE", !12, i64 0}
!34 = !{!"_ZTSN4oboe11InputPresetE", !12, i64 0}
!35 = !{!"_ZTSN4oboe9SessionIdE", !12, i64 0}
!36 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !37, i64 0, !38, i64 8, !12, i64 16}
!37 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!38 = !{!"long", !12, i64 0}
!39 = !{!"bool", !12, i64 0}
!40 = !{!"_ZTSN4oboe27SampleRateConversionQualityE", !12, i64 0}
!41 = !{!"_ZTSN4oboe8AudioApiE", !12, i64 0}
!42 = !{!"_ZTSSt6vectorIfSaIfEE", !43, i64 0}
!43 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !44, i64 0}
!44 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!46 = !{!47, !47, i64 0}
!47 = !{!"vtable pointer", !13, i64 0}


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