; LLVM IR from gem5/gem5 :: src/mem/ruby/profiler/StoreTrace.ll (ZN4gem54ruby10StoreTrace9downgradeEj)

; 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.gem5::ruby::StoreTrace" = type { i64, i32, i64, i64, i32, i64, %"class.gem5::ruby::Histogram", %"class.gem5::ruby::Histogram", %"class.gem5::ruby::Histogram", %"class.gem5::ruby::Histogram" }
%"class.gem5::ruby::Histogram" = type { %"class.std::vector", i64, i64, i32, i32, i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN4gem54ruby10StoreTrace15s_total_samplesE = external dso_local global i64, align 8
@_ZN4gem54ruby10StoreTrace17s_store_count_ptrE = external dso_local global ptr, align 8
@_ZN4gem54ruby10StoreTrace27s_store_first_to_stolen_ptrE = external dso_local global ptr, align 8
@_ZN4gem54ruby10StoreTrace26s_store_last_to_stolen_ptrE = external dso_local global ptr, align 8
@_ZN4gem54ruby10StoreTrace25s_store_first_to_last_ptrE = external dso_local global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj = external hidden unnamed_addr constant [47 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [36 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4gem57curTickEv() #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; 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 void @_ZN4gem54ruby10StoreTrace9downgradeEj(ptr noundef nonnull align 8 dereferenceable(304) %0, i32 noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  %7 = load i32, ptr %4, align 4, !tbaa !9
  %8 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 1
  %9 = load i32, ptr %8, align 8, !tbaa !11
  %10 = icmp eq i32 %7, %9
  br i1 %10, label %11, label %96

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %12 = call noundef i64 @_ZN4gem57curTickEv()
  store i64 %12, ptr %5, align 8, !tbaa !19
  %13 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 4
  %14 = load i32, ptr %13, align 8, !tbaa !20
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %11
  br label %19

17:                                               ; preds = %11
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.7, i32 noundef 139, ptr noundef @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #6
  unreachable

18:                                               ; No predecessors!
  br label %19

19:                                               ; preds = %18, %16
  %20 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 3
  %21 = load i64, ptr %20, align 8, !tbaa !21
  %22 = icmp ne i64 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %19
  br label %26

24:                                               ; preds = %19
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.7, i32 noundef 140, ptr noundef @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #6
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  %27 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 2
  %28 = load i64, ptr %27, align 8, !tbaa !22
  %29 = icmp ne i64 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %26
  br label %33

31:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.7, i32 noundef 141, ptr noundef @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #6
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  %34 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 1
  %35 = load i32, ptr %34, align 8, !tbaa !11
  %36 = icmp ne i32 %35, -1
  br i1 %36, label %37, label %38

37:                                               ; preds = %33
  br label %40

38:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.7, i32 noundef 142, ptr noundef @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #6
  unreachable

39:                                               ; No predecessors!
  br label %40

40:                                               ; preds = %39, %37
  %41 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 7
  %42 = load i64, ptr %5, align 8, !tbaa !19
  %43 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 2
  %44 = load i64, ptr %43, align 8, !tbaa !22
  %45 = sub i64 %42, %44
  call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %41, i64 noundef %45)
  %46 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 6
  %47 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 4
  %48 = load i32, ptr %47, align 8, !tbaa !20
  %49 = sext i32 %48 to i64
  call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %46, i64 noundef %49)
  %50 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 8
  %51 = load i64, ptr %5, align 8, !tbaa !19
  %52 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 3
  %53 = load i64, ptr %52, align 8, !tbaa !21
  %54 = sub i64 %51, %53
  call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %50, i64 noundef %54)
  %55 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 9
  %56 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 3
  %57 = load i64, ptr %56, align 8, !tbaa !21
  %58 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 2
  %59 = load i64, ptr %58, align 8, !tbaa !22
  %60 = sub i64 %57, %59
  call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %55, i64 noundef %60)
  %61 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 5
  %62 = load i64, ptr %61, align 8, !tbaa !23
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %61, align 8, !tbaa !23
  %64 = load ptr, ptr @_ZN4gem54ruby10StoreTrace27s_store_first_to_stolen_ptrE, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %67

66:                                               ; preds = %40
  br label %69

67:                                               ; preds = %40
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.7, i32 noundef 152, ptr noundef @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #6
  unreachable

68:                                               ; No predecessors!
  br label %69

69:                                               ; preds = %68, %66
  %70 = load ptr, ptr @_ZN4gem54ruby10StoreTrace27s_store_first_to_stolen_ptrE, align 8, !tbaa !5
  %71 = load i64, ptr %5, align 8, !tbaa !19
  %72 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 2
  %73 = load i64, ptr %72, align 8, !tbaa !22
  %74 = sub i64 %71, %73
  call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %70, i64 noundef %74)
  %75 = load ptr, ptr @_ZN4gem54ruby10StoreTrace17s_store_count_ptrE, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 4
  %77 = load i32, ptr %76, align 8, !tbaa !20
  %78 = sext i32 %77 to i64
  call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %75, i64 noundef %78)
  %79 = load ptr, ptr @_ZN4gem54ruby10StoreTrace26s_store_last_to_stolen_ptrE, align 8, !tbaa !5
  %80 = load i64, ptr %5, align 8, !tbaa !19
  %81 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 3
  %82 = load i64, ptr %81, align 8, !tbaa !21
  %83 = sub i64 %80, %82
  call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %79, i64 noundef %83)
  %84 = load ptr, ptr @_ZN4gem54ruby10StoreTrace25s_store_first_to_last_ptrE, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 3
  %86 = load i64, ptr %85, align 8, !tbaa !21
  %87 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 2
  %88 = load i64, ptr %87, align 8, !tbaa !22
  %89 = sub i64 %86, %88
  call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %84, i64 noundef %89)
  %90 = load i64, ptr @_ZN4gem54ruby10StoreTrace15s_total_samplesE, align 8, !tbaa !19
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr @_ZN4gem54ruby10StoreTrace15s_total_samplesE, align 8, !tbaa !19
  %92 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 4
  store i32 0, ptr %92, align 8, !tbaa !20
  %93 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 3
  store i64 0, ptr %93, align 8, !tbaa !21
  %94 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 2
  store i64 0, ptr %94, align 8, !tbaa !22
  %95 = getelementptr inbounds %"class.gem5::ruby::StoreTrace", ptr %6, i32 0, i32 1
  store i32 -1, ptr %95, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %96

96:                                               ; preds = %69, %2
  ret void
}

declare void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn nounwind "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 = { "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 #5 = { nounwind }
attributes #6 = { noreturn 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, !10, i64 8}
!12 = !{!"_ZTSN4gem54ruby10StoreTraceE", !13, i64 0, !10, i64 8, !13, i64 16, !13, i64 24, !10, i64 32, !13, i64 40, !14, i64 48, !14, i64 112, !14, i64 176, !14, i64 240}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN4gem54ruby9HistogramE", !15, i64 0, !13, i64 24, !13, i64 32, !10, i64 40, !10, i64 44, !13, i64 48, !13, i64 56}
!15 = !{!"_ZTSSt6vectorImSaImEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseImSaImEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!13, !13, i64 0}
!20 = !{!12, !10, i64 32}
!21 = !{!12, !13, i64 24}
!22 = !{!12, !13, i64 16}
!23 = !{!12, !13, i64 40}


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

@_ZN4gem54ruby10StoreTrace15s_total_samplesE = external dso_local local_unnamed_addr global i64, align 8
@_ZN4gem54ruby10StoreTrace17s_store_count_ptrE = external dso_local local_unnamed_addr global ptr, align 8
@_ZN4gem54ruby10StoreTrace27s_store_first_to_stolen_ptrE = external dso_local local_unnamed_addr global ptr, align 8
@_ZN4gem54ruby10StoreTrace26s_store_last_to_stolen_ptrE = external dso_local local_unnamed_addr global ptr, align 8
@_ZN4gem54ruby10StoreTrace25s_store_first_to_last_ptrE = external dso_local local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj = external hidden unnamed_addr constant [47 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4gem57curTickEv() local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4gem54ruby10StoreTrace9downgradeEj(ptr noundef nonnull align 8 dereferenceable(304) %0, i32 noundef %1) local_unnamed_addr #2 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp eq i32 %4, %1
  br i1 %5, label %6, label %55

6:                                                ; preds = %2
  %7 = tail call noundef i64 @_ZN4gem57curTickEv()
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load i32, ptr %8, align 8, !tbaa !17
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %11

10:                                               ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.7, i32 noundef 139, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #5
  unreachable

11:                                               ; preds = %6
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = load i64, ptr %12, align 8, !tbaa !18
  %.not6 = icmp eq i64 %13, 0
  br i1 %.not6, label %14, label %15

14:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.7, i32 noundef 140, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #5
  unreachable

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = load i64, ptr %16, align 8, !tbaa !19
  %.not7 = icmp eq i64 %17, 0
  br i1 %.not7, label %18, label %19

18:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.7, i32 noundef 141, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #5
  unreachable

19:                                               ; preds = %15
  %20 = load i32, ptr %3, align 8, !tbaa !5
  %.not8 = icmp eq i32 %20, -1
  br i1 %.not8, label %21, label %22

21:                                               ; preds = %19
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.7, i32 noundef 142, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #5
  unreachable

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %0, i64 112
  %24 = sub i64 %7, %17
  tail call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %23, i64 noundef %24)
  %25 = getelementptr inbounds i8, ptr %0, i64 48
  %26 = load i32, ptr %8, align 8, !tbaa !17
  %27 = sext i32 %26 to i64
  tail call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %25, i64 noundef %27)
  %28 = getelementptr inbounds i8, ptr %0, i64 176
  %29 = load i64, ptr %12, align 8, !tbaa !18
  %30 = sub i64 %7, %29
  tail call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %28, i64 noundef %30)
  %31 = getelementptr inbounds i8, ptr %0, i64 240
  %32 = load i64, ptr %12, align 8, !tbaa !18
  %33 = load i64, ptr %16, align 8, !tbaa !19
  %34 = sub i64 %32, %33
  tail call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %31, i64 noundef %34)
  %35 = getelementptr inbounds i8, ptr %0, i64 40
  %36 = load i64, ptr %35, align 8, !tbaa !20
  %37 = add nsw i64 %36, 1
  store i64 %37, ptr %35, align 8, !tbaa !20
  %38 = load ptr, ptr @_ZN4gem54ruby10StoreTrace27s_store_first_to_stolen_ptrE, align 8, !tbaa !21
  %.not9 = icmp eq ptr %38, null
  br i1 %.not9, label %39, label %40

39:                                               ; preds = %22
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.7, i32 noundef 152, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4gem54ruby10StoreTrace9downgradeEj) #5
  unreachable

40:                                               ; preds = %22
  %41 = load i64, ptr %16, align 8, !tbaa !19
  %42 = sub i64 %7, %41
  tail call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %38, i64 noundef %42)
  %43 = load ptr, ptr @_ZN4gem54ruby10StoreTrace17s_store_count_ptrE, align 8, !tbaa !21
  %44 = load i32, ptr %8, align 8, !tbaa !17
  %45 = sext i32 %44 to i64
  tail call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %43, i64 noundef %45)
  %46 = load ptr, ptr @_ZN4gem54ruby10StoreTrace26s_store_last_to_stolen_ptrE, align 8, !tbaa !21
  %47 = load i64, ptr %12, align 8, !tbaa !18
  %48 = sub i64 %7, %47
  tail call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %46, i64 noundef %48)
  %49 = load ptr, ptr @_ZN4gem54ruby10StoreTrace25s_store_first_to_last_ptrE, align 8, !tbaa !21
  %50 = load i64, ptr %12, align 8, !tbaa !18
  %51 = load i64, ptr %16, align 8, !tbaa !19
  %52 = sub i64 %50, %51
  tail call void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64) %49, i64 noundef %52)
  %53 = load i64, ptr @_ZN4gem54ruby10StoreTrace15s_total_samplesE, align 8, !tbaa !22
  %54 = add nsw i64 %53, 1
  store i64 %54, ptr @_ZN4gem54ruby10StoreTrace15s_total_samplesE, align 8, !tbaa !22
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %16, i8 0, i64 20, i1 false)
  store i32 -1, ptr %3, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %40, %2
  ret void
}

declare void @_ZN4gem54ruby9Histogram3addEl(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { 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 #1 = { noreturn nounwind "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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { noreturn 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, !10, i64 8}
!6 = !{!"_ZTSN4gem54ruby10StoreTraceE", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !11, i64 48, !11, i64 112, !11, i64 176, !11, i64 240}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN4gem54ruby9HistogramE", !12, i64 0, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !7, i64 48, !7, i64 56}
!12 = !{!"_ZTSSt6vectorImSaImEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseImSaImEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!6, !10, i64 32}
!18 = !{!6, !7, i64 24}
!19 = !{!6, !7, i64 16}
!20 = !{!6, !7, i64 40}
!21 = !{!16, !16, i64 0}
!22 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass