; LLVM IR from chriskiefer/libcccrt :: benchmarks/maximilian.ll (ZN10maxiSample8playOnceEv)

; 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.maxiSample = type { double, double, double, double, %class.maxiLagExp, i16, i32, i16, [6 x i8], %class.maxiTrigger, %"class.std::vector", %"class.std::__cxx11::basic_string", i32, i32, i32, i16, i32, i16, i8, double }
%class.maxiLagExp = type { double, double, double }
%class.maxiTrigger = type <{ double, i8, [7 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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] }

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN10maxiSample8playOnceEv(ptr noundef nonnull align 8 dereferenceable(176) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %class.maxiSample, ptr %3, i32 0, i32 0
  %5 = load double, ptr %4, align 8, !tbaa !9
  %6 = fptosi double %5 to i64
  %7 = getelementptr inbounds %class.maxiSample, ptr %3, i32 0, i32 10
  %8 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #1
  %9 = icmp ult i64 %6, %8
  br i1 %9, label %10, label %18

10:                                               ; preds = %1
  %11 = getelementptr inbounds %class.maxiSample, ptr %3, i32 0, i32 10
  %12 = getelementptr inbounds %class.maxiSample, ptr %3, i32 0, i32 0
  %13 = load double, ptr %12, align 8, !tbaa !9
  %14 = fptosi double %13 to i64
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %14) #1
  %16 = load double, ptr %15, align 8, !tbaa !24
  %17 = getelementptr inbounds %class.maxiSample, ptr %3, i32 0, i32 3
  store double %16, ptr %17, align 8, !tbaa !25
  br label %20

18:                                               ; preds = %1
  %19 = getelementptr inbounds %class.maxiSample, ptr %3, i32 0, i32 3
  store double 0.000000e+00, ptr %19, align 8, !tbaa !25
  br label %20

20:                                               ; preds = %18, %10
  %21 = getelementptr inbounds %class.maxiSample, ptr %3, i32 0, i32 0
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = fadd double %22, 1.000000e+00
  store double %23, ptr %21, align 8, !tbaa !9
  %24 = getelementptr inbounds %class.maxiSample, ptr %3, i32 0, i32 3
  %25 = load double, ptr %24, align 8, !tbaa !25
  ret double %25
}

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 = { 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, !11, i64 0}
!10 = !{!"_ZTS10maxiSample", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !13, i64 56, !14, i64 60, !13, i64 64, !15, i64 72, !17, i64 88, !21, i64 112, !14, i64 144, !14, i64 148, !14, i64 152, !13, i64 156, !14, i64 160, !13, i64 164, !16, i64 166, !11, i64 168}
!11 = !{!"double", !7, i64 0}
!12 = !{!"_ZTS10maxiLagExpIdE", !11, i64 0, !11, i64 8, !11, i64 16}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS11maxiTrigger", !11, i64 0, !16, i64 8}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt6vectorIdSaIdEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !22, i64 0, !23, i64 8, !7, i64 16}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!11, !11, i64 0}
!25 = !{!10, !11, i64 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(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 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN10maxiSample8playOnceEv(ptr noundef nonnull align 8 dereferenceable(176) %0) local_unnamed_addr #0 align 2 {
  %2 = load double, ptr %0, align 8, !tbaa !5
  %3 = fptosi double %2 to i64
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  %5 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #1
  %6 = icmp ugt i64 %5, %3
  br i1 %6, label %7, label %12

7:                                                ; preds = %1
  %8 = load double, ptr %0, align 8, !tbaa !5
  %9 = fptosi double %8 to i64
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #1
  %11 = load double, ptr %10, align 8, !tbaa !23
  br label %12

12:                                               ; preds = %1, %7
  %.sink = phi double [ %11, %7 ], [ 0.000000e+00, %1 ]
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  store double %.sink, ptr %13, align 8
  %14 = load double, ptr %0, align 8, !tbaa !5
  %15 = fadd double %14, 1.000000e+00
  store double %15, ptr %0, align 8, !tbaa !5
  ret double %.sink
}

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 = { 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, !7, i64 0}
!6 = !{!"_ZTS10maxiSample", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 56, !12, i64 60, !11, i64 64, !13, i64 72, !15, i64 88, !20, i64 112, !12, i64 144, !12, i64 148, !12, i64 152, !11, i64 156, !12, i64 160, !11, i64 164, !14, i64 166, !7, i64 168}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS10maxiLagExpIdE", !7, i64 0, !7, i64 8, !7, i64 16}
!11 = !{!"short", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTS11maxiTrigger", !7, i64 0, !14, i64 8}
!14 = !{!"bool", !8, i64 0}
!15 = !{!"_ZTSSt6vectorIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !22, i64 8, !8, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !19, i64 0}
!22 = !{!"long", !8, i64 0}
!23 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,MergedLoadStoreMotionPass,SROAPass,TailCallElimPass