; LLVM IR from mitdbg/deneva :: system/txn.ll (ZN10TxnManager7cleanupE2RC)

; 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.Stats = type { ptr, ptr, i64, i64, i64, i64 }
%class.TxnManager = type { ptr, ptr, ptr, i8, ptr, i32, i8, i32, i32, i8, i64, i64, i64, i64, ptr, ptr, ptr, i64, i8, i8, ptr, ptr, i64, i64, i64, %class.TxnStats, i32, i32, i32, i8, i32, %class.Array.0, i32, ptr, ptr, i32, %union.sem_t }
%class.TxnStats = type { i64, i64, i64, i64, i64, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i64, i64, double, double, double, double, double, double, double, double }
%class.Array.0 = type { ptr, i64, i64 }
%union.sem_t = type { i64, [24 x i8] }
%class.Transaction = type <{ %class.Array, i64, i64, i64, i64, i64, i32, [4 x i8], %class.Array.0, i64, i64, i32, [4 x i8] }>
%class.Array = type { ptr, i64, i64 }
%class.Stats_thd = type { [64 x i8], ptr, ptr, double, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, double, i64, double, i64, double, i64, i64, double, double, double, double, double, double, double, double, i64, double, double, double, double, double, double, double, double, i64, i64, double, i64, double, i64, double, double, double, i64, i64, i64, double, double, double, double, double, double, double, double, double, i64, ptr, ptr, double, i64, i64, double, double, double, i64, i64, i64, i64, i64, i64, i64, double, double, double, i64, i64, i64, i64, i64, i64, i64, i64, i64, double, double, double, double, double, i64, i64, double, double, i64, i64, i64, double, double, i64, i64, double, double, double, double, i64, i64, double, double, double, i64, i64, double, double, double, double, double, i64, double, double, double, double, double, double, double, double, i64, i64, i64, double, i64, double, double, i64, i64, i64, i64, i64, double, i64, i64, double, i64, double, double, i64, i64, i64, i64, i64, double, double, double, %class.StatsArr, %class.StatsArr, %class.StatsArr, %class.StatsArr, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, ptr, [64 x i8] }
%class.StatsArr = type { ptr, i64, i64, i32, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@simulation = external global ptr, align 8
@stats = external global %class.Stats, align 8
@.str.8 = external hidden unnamed_addr constant [42 x i8], align 1
@__PRETTY_FUNCTION__._ZN10TxnManager7cleanupE2RC = external hidden unnamed_addr constant [29 x i8], align 1

declare noundef i64 @_Z13get_sys_clockv() #0

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

declare noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96)) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11Transaction15release_insertsEm(ptr noundef nonnull align 8 dereferenceable(116), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10TxnManager11cleanup_rowE2RCm(ptr noundef nonnull align 8 dereferenceable(544), i32 noundef, i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10TxnManager7cleanupE2RC(ptr noundef nonnull align 8 dereferenceable(544) %0, i32 noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %8 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %9 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %9, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %10 = getelementptr inbounds %class.TxnManager, ptr %8, i32 0, i32 20
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds %class.Transaction, ptr %11, i32 0, i32 0
  %13 = call noundef i64 @_ZN5ArrayIP6AccessE9get_countEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  store i64 %13, ptr %6, align 8, !tbaa !11
  %14 = getelementptr inbounds %class.TxnManager, ptr %8, i32 0, i32 20
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  %16 = getelementptr inbounds %class.Transaction, ptr %15, i32 0, i32 0
  %17 = call noundef i64 @_ZN5ArrayIP6AccessE9get_countEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = getelementptr inbounds %class.TxnManager, ptr %8, i32 0, i32 20
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = getelementptr inbounds %class.Transaction, ptr %19, i32 0, i32 5
  %21 = load i64, ptr %20, align 8, !tbaa !22
  %22 = icmp eq i64 %17, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %2
  br label %26

24:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 754, ptr noundef @__PRETTY_FUNCTION__._ZN10TxnManager7cleanupE2RC) #6
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %27 = load i64, ptr %6, align 8, !tbaa !11
  %28 = sub i64 %27, 1
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %7, align 4, !tbaa !26
  br label %30

30:                                               ; preds = %38, %26
  %31 = load i32, ptr %7, align 4, !tbaa !26
  %32 = icmp sge i32 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %41

34:                                               ; preds = %30
  %35 = load i32, ptr %4, align 4, !tbaa !9
  %36 = load i32, ptr %7, align 4, !tbaa !26
  %37 = sext i32 %36 to i64
  call void @_ZN10TxnManager11cleanup_rowE2RCm(ptr noundef nonnull align 8 dereferenceable(544) %8, i32 noundef %35, i64 noundef %37)
  br label %38

38:                                               ; preds = %34
  %39 = load i32, ptr %7, align 4, !tbaa !26
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %7, align 4, !tbaa !26
  br label %30, !llvm.loop !27

41:                                               ; preds = %33
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 2
  br i1 %43, label %44, label %66

44:                                               ; preds = %41
  %45 = getelementptr inbounds %class.TxnManager, ptr %8, i32 0, i32 20
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %8)
  call void @_ZN11Transaction15release_insertsEm(ptr noundef nonnull align 8 dereferenceable(116) %46, i64 noundef %47)
  %48 = getelementptr inbounds %class.TxnManager, ptr %8, i32 0, i32 20
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  %50 = getelementptr inbounds %class.Transaction, ptr %49, i32 0, i32 8
  call void @_ZN5ArrayIP5row_tE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %50)
  %51 = load ptr, ptr @simulation, align 8, !tbaa !5
  %52 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %51)
  br i1 %52, label %53, label %65

53:                                               ; preds = %44
  %54 = call noundef i64 @_Z13get_sys_clockv()
  %55 = load i64, ptr %5, align 8, !tbaa !11
  %56 = sub i64 %54, %55
  %57 = uitofp i64 %56 to double
  %58 = load ptr, ptr @stats, align 8, !tbaa !29
  %59 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %8)
  %60 = getelementptr inbounds ptr, ptr %58, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.Stats_thd, ptr %61, i32 0, i32 34
  %63 = load double, ptr %62, align 8, !tbaa !31
  %64 = fadd double %63, %57
  store double %64, ptr %62, align 8, !tbaa !31
  br label %65

65:                                               ; preds = %53, %44
  br label %66

66:                                               ; preds = %65, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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

attributes #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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{!"_ZTS2RC", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 136}
!14 = !{!"_ZTS10TxnManager", !6, i64 8, !6, i64 16, !15, i64 24, !6, i64 32, !16, i64 40, !15, i64 44, !16, i64 48, !16, i64 52, !15, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !15, i64 128, !15, i64 129, !6, i64 136, !6, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !17, i64 176, !16, i64 432, !16, i64 436, !16, i64 440, !15, i64 444, !19, i64 448, !20, i64 456, !16, i64 480, !6, i64 488, !6, i64 496, !21, i64 504, !7, i64 512}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTS8TxnStats", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !18, i64 40, !18, i64 48, !18, i64 56, !18, i64 64, !18, i64 72, !18, i64 80, !18, i64 88, !18, i64 96, !18, i64 104, !18, i64 112, !18, i64 120, !18, i64 128, !18, i64 136, !18, i64 144, !18, i64 152, !18, i64 160, !18, i64 168, !12, i64 176, !12, i64 184, !18, i64 192, !18, i64 200, !18, i64 208, !18, i64 216, !18, i64 224, !18, i64 232, !18, i64 240, !18, i64 248}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTS12CALVIN_PHASE", !7, i64 0}
!20 = !{!"_ZTS5ArrayIP5row_tE", !6, i64 0, !12, i64 8, !12, i64 16}
!21 = !{!"_ZTS8access_t", !7, i64 0}
!22 = !{!23, !12, i64 56}
!23 = !{!"_ZTS11Transaction", !24, i64 0, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !25, i64 64, !20, i64 72, !12, i64 96, !12, i64 104, !10, i64 112}
!24 = !{!"_ZTS5ArrayIP6AccessE", !6, i64 0, !12, i64 8, !12, i64 16}
!25 = !{!"_ZTS8TxnState", !7, i64 0}
!26 = !{!16, !16, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!30, !6, i64 0}
!30 = !{!"_ZTS5Stats", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!31 = !{!32, !18, i64 328}
!32 = !{!"_ZTS9Stats_thd", !7, i64 0, !6, i64 64, !6, i64 72, !18, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !18, i64 184, !12, i64 192, !18, i64 200, !12, i64 208, !18, i64 216, !12, i64 224, !12, i64 232, !18, i64 240, !18, i64 248, !18, i64 256, !18, i64 264, !18, i64 272, !18, i64 280, !18, i64 288, !18, i64 296, !12, i64 304, !18, i64 312, !18, i64 320, !18, i64 328, !18, i64 336, !18, i64 344, !18, i64 352, !18, i64 360, !18, i64 368, !12, i64 376, !12, i64 384, !18, i64 392, !12, i64 400, !18, i64 408, !12, i64 416, !18, i64 424, !18, i64 432, !18, i64 440, !12, i64 448, !12, i64 456, !12, i64 464, !18, i64 472, !18, i64 480, !18, i64 488, !18, i64 496, !18, i64 504, !18, i64 512, !18, i64 520, !18, i64 528, !18, i64 536, !12, i64 544, !6, i64 552, !6, i64 560, !18, i64 568, !12, i64 576, !12, i64 584, !18, i64 592, !18, i64 600, !18, i64 608, !12, i64 616, !12, i64 624, !12, i64 632, !12, i64 640, !12, i64 648, !12, i64 656, !12, i64 664, !18, i64 672, !18, i64 680, !18, i64 688, !12, i64 696, !12, i64 704, !12, i64 712, !12, i64 720, !12, i64 728, !12, i64 736, !12, i64 744, !12, i64 752, !12, i64 760, !18, i64 768, !18, i64 776, !18, i64 784, !18, i64 792, !18, i64 800, !12, i64 808, !12, i64 816, !18, i64 824, !18, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !18, i64 864, !18, i64 872, !12, i64 880, !12, i64 888, !18, i64 896, !18, i64 904, !18, i64 912, !18, i64 920, !12, i64 928, !12, i64 936, !18, i64 944, !18, i64 952, !18, i64 960, !12, i64 968, !12, i64 976, !18, i64 984, !18, i64 992, !18, i64 1000, !18, i64 1008, !18, i64 1016, !12, i64 1024, !18, i64 1032, !18, i64 1040, !18, i64 1048, !18, i64 1056, !18, i64 1064, !18, i64 1072, !18, i64 1080, !18, i64 1088, !12, i64 1096, !12, i64 1104, !12, i64 1112, !18, i64 1120, !12, i64 1128, !18, i64 1136, !18, i64 1144, !12, i64 1152, !12, i64 1160, !12, i64 1168, !12, i64 1176, !12, i64 1184, !18, i64 1192, !12, i64 1200, !12, i64 1208, !18, i64 1216, !12, i64 1224, !18, i64 1232, !18, i64 1240, !12, i64 1248, !12, i64 1256, !12, i64 1264, !12, i64 1272, !12, i64 1280, !18, i64 1288, !18, i64 1296, !18, i64 1304, !33, i64 1312, !33, i64 1384, !33, i64 1456, !33, i64 1528, !18, i64 1600, !18, i64 1608, !18, i64 1616, !18, i64 1624, !18, i64 1632, !18, i64 1640, !18, i64 1648, !18, i64 1656, !18, i64 1664, !18, i64 1672, !18, i64 1680, !18, i64 1688, !18, i64 1696, !18, i64 1704, !18, i64 1712, !18, i64 1720, !18, i64 1728, !18, i64 1736, !18, i64 1744, !18, i64 1752, !18, i64 1760, !18, i64 1768, !18, i64 1776, !18, i64 1784, !18, i64 1792, !18, i64 1800, !18, i64 1808, !18, i64 1816, !18, i64 1824, !18, i64 1832, !18, i64 1840, !18, i64 1848, !18, i64 1856, !18, i64 1864, !18, i64 1872, !18, i64 1880, !6, i64 1888, !7, i64 1896}
!33 = !{!"_ZTS8StatsArr", !6, i64 0, !12, i64 8, !12, i64 16, !34, i64 24, !7, i64 32}
!34 = !{!"_ZTS12StatsArrType", !7, 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"

%class.Stats = type { ptr, ptr, i64, i64, i64, i64 }

@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@simulation = external local_unnamed_addr global ptr, align 8
@stats = external local_unnamed_addr global %class.Stats, align 8
@.str.8 = external hidden unnamed_addr constant [42 x i8], align 1
@__PRETTY_FUNCTION__._ZN10TxnManager7cleanupE2RC = external hidden unnamed_addr constant [29 x i8], align 1

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #0

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

declare noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10TxnManager11cleanup_rowE2RCm(ptr noundef nonnull align 8 dereferenceable(544), i32 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10TxnManager7cleanupE2RC(ptr noundef nonnull align 8 dereferenceable(544) %0, i32 noundef %1) local_unnamed_addr #3 align 2 {
  %3 = tail call noundef i64 @_Z13get_sys_clockv()
  %4 = getelementptr inbounds i8, ptr %0, i64 136
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = tail call noundef i64 @_ZN5ArrayIP6AccessE9get_countEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = tail call noundef i64 @_ZN5ArrayIP6AccessE9get_countEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 56
  %11 = load i64, ptr %10, align 8, !tbaa !18
  %12 = icmp eq i64 %8, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 754, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN10TxnManager7cleanupE2RC) #4
  unreachable

14:                                               ; preds = %2
  %15 = trunc i64 %6 to i32
  %.07 = add i32 %15, -1
  %16 = icmp sgt i32 %.07, -1
  br i1 %16, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %14
  %17 = zext nneg i32 %.07 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %14
  %18 = icmp eq i32 %1, 2
  br i1 %18, label %19, label %37

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %17, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  tail call void @_ZN10TxnManager11cleanup_rowE2RCm(ptr noundef nonnull align 8 dereferenceable(544) %0, i32 noundef %1, i64 noundef %indvars.iv)
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not = icmp eq i64 %indvars.iv, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !23

19:                                               ; preds = %._crit_edge
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  tail call void @_ZN11Transaction15release_insertsEm(ptr noundef nonnull align 8 dereferenceable(116) %20, i64 noundef %21)
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 72
  tail call void @_ZN5ArrayIP5row_tE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %24 = load ptr, ptr @simulation, align 8, !tbaa !25
  %25 = tail call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %24)
  br i1 %25, label %26, label %37

26:                                               ; preds = %19
  %27 = tail call noundef i64 @_Z13get_sys_clockv()
  %28 = sub i64 %27, %3
  %29 = uitofp i64 %28 to double
  %30 = load ptr, ptr @stats, align 8, !tbaa !26
  %31 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  %32 = getelementptr inbounds ptr, ptr %30, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !25
  %34 = getelementptr inbounds i8, ptr %33, i64 328
  %35 = load double, ptr %34, align 8, !tbaa !28
  %36 = fadd double %35, %29
  store double %36, ptr %34, align 8, !tbaa !28
  br label %37

37:                                               ; preds = %19, %26, %._crit_edge
  ret void
}

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

attributes #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 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 = { 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, !7, i64 136}
!6 = !{!"_ZTS10TxnManager", !7, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !11, i64 40, !10, i64 44, !11, i64 48, !11, i64 52, !10, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !12, i64 120, !10, i64 128, !10, i64 129, !7, i64 136, !7, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !13, i64 176, !11, i64 432, !11, i64 436, !11, i64 440, !10, i64 444, !15, i64 448, !16, i64 456, !11, i64 480, !7, i64 488, !7, i64 496, !17, i64 504, !8, i64 512}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_ZTS8TxnStats", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !12, i64 176, !12, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !14, i64 224, !14, i64 232, !14, i64 240, !14, i64 248}
!14 = !{!"double", !8, i64 0}
!15 = !{!"_ZTS12CALVIN_PHASE", !8, i64 0}
!16 = !{!"_ZTS5ArrayIP5row_tE", !7, i64 0, !12, i64 8, !12, i64 16}
!17 = !{!"_ZTS8access_t", !8, i64 0}
!18 = !{!19, !12, i64 56}
!19 = !{!"_ZTS11Transaction", !20, i64 0, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !21, i64 64, !16, i64 72, !12, i64 96, !12, i64 104, !22, i64 112}
!20 = !{!"_ZTS5ArrayIP6AccessE", !7, i64 0, !12, i64 8, !12, i64 16}
!21 = !{!"_ZTS8TxnState", !8, i64 0}
!22 = !{!"_ZTS2RC", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !7, i64 0}
!27 = !{!"_ZTS5Stats", !7, i64 0, !7, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!28 = !{!29, !14, i64 328}
!29 = !{!"_ZTS9Stats_thd", !8, i64 0, !7, i64 64, !7, i64 72, !14, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !14, i64 184, !12, i64 192, !14, i64 200, !12, i64 208, !14, i64 216, !12, i64 224, !12, i64 232, !14, i64 240, !14, i64 248, !14, i64 256, !14, i64 264, !14, i64 272, !14, i64 280, !14, i64 288, !14, i64 296, !12, i64 304, !14, i64 312, !14, i64 320, !14, i64 328, !14, i64 336, !14, i64 344, !14, i64 352, !14, i64 360, !14, i64 368, !12, i64 376, !12, i64 384, !14, i64 392, !12, i64 400, !14, i64 408, !12, i64 416, !14, i64 424, !14, i64 432, !14, i64 440, !12, i64 448, !12, i64 456, !12, i64 464, !14, i64 472, !14, i64 480, !14, i64 488, !14, i64 496, !14, i64 504, !14, i64 512, !14, i64 520, !14, i64 528, !14, i64 536, !12, i64 544, !7, i64 552, !7, i64 560, !14, i64 568, !12, i64 576, !12, i64 584, !14, i64 592, !14, i64 600, !14, i64 608, !12, i64 616, !12, i64 624, !12, i64 632, !12, i64 640, !12, i64 648, !12, i64 656, !12, i64 664, !14, i64 672, !14, i64 680, !14, i64 688, !12, i64 696, !12, i64 704, !12, i64 712, !12, i64 720, !12, i64 728, !12, i64 736, !12, i64 744, !12, i64 752, !12, i64 760, !14, i64 768, !14, i64 776, !14, i64 784, !14, i64 792, !14, i64 800, !12, i64 808, !12, i64 816, !14, i64 824, !14, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !14, i64 864, !14, i64 872, !12, i64 880, !12, i64 888, !14, i64 896, !14, i64 904, !14, i64 912, !14, i64 920, !12, i64 928, !12, i64 936, !14, i64 944, !14, i64 952, !14, i64 960, !12, i64 968, !12, i64 976, !14, i64 984, !14, i64 992, !14, i64 1000, !14, i64 1008, !14, i64 1016, !12, i64 1024, !14, i64 1032, !14, i64 1040, !14, i64 1048, !14, i64 1056, !14, i64 1064, !14, i64 1072, !14, i64 1080, !14, i64 1088, !12, i64 1096, !12, i64 1104, !12, i64 1112, !14, i64 1120, !12, i64 1128, !14, i64 1136, !14, i64 1144, !12, i64 1152, !12, i64 1160, !12, i64 1168, !12, i64 1176, !12, i64 1184, !14, i64 1192, !12, i64 1200, !12, i64 1208, !14, i64 1216, !12, i64 1224, !14, i64 1232, !14, i64 1240, !12, i64 1248, !12, i64 1256, !12, i64 1264, !12, i64 1272, !12, i64 1280, !14, i64 1288, !14, i64 1296, !14, i64 1304, !30, i64 1312, !30, i64 1384, !30, i64 1456, !30, i64 1528, !14, i64 1600, !14, i64 1608, !14, i64 1616, !14, i64 1624, !14, i64 1632, !14, i64 1640, !14, i64 1648, !14, i64 1656, !14, i64 1664, !14, i64 1672, !14, i64 1680, !14, i64 1688, !14, i64 1696, !14, i64 1704, !14, i64 1712, !14, i64 1720, !14, i64 1728, !14, i64 1736, !14, i64 1744, !14, i64 1752, !14, i64 1760, !14, i64 1768, !14, i64 1776, !14, i64 1784, !14, i64 1792, !14, i64 1800, !14, i64 1808, !14, i64 1816, !14, i64 1824, !14, i64 1832, !14, i64 1840, !14, i64 1848, !14, i64 1856, !14, i64 1864, !14, i64 1872, !14, i64 1880, !7, i64 1888, !8, i64 1896}
!30 = !{!"_ZTS8StatsArr", !7, i64 0, !12, i64 8, !12, i64 16, !31, i64 24, !8, i64 32}
!31 = !{!"_ZTS12StatsArrType", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass