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

; 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.AccessPool = type { ptr, ptr }
%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.Access = type { i32, ptr, ptr, ptr }
%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
@access_pool = external global %class.AccessPool, align 8
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN10TxnManager17get_row_post_waitERP5row_t = external hidden unnamed_addr constant [43 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

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

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

declare void @_ZN10AccessPool3getEmRP6Access(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) #0

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

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

18:                                               ; preds = %2
  br label %21

19:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 865, ptr noundef @__PRETTY_FUNCTION__._ZN10TxnManager17get_row_post_waitERP5row_t) #6
  unreachable

20:                                               ; No predecessors!
  br label %21

21:                                               ; preds = %20, %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %22 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %10)
  call void @_ZN10AccessPool3getEmRP6Access(ptr noundef nonnull align 8 dereferenceable(16) @access_pool, i64 noundef %22, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load i32, ptr %7, align 4, !tbaa !21
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %class.Access, ptr %25, i32 0, i32 2
  %27 = call noundef i32 @_ZN5row_t17get_row_post_waitE8access_tP10TxnManagerRPS_(ptr noundef nonnull align 8 dereferenceable(64) %23, i32 noundef %24, ptr noundef %10, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = load i32, ptr %7, align 4, !tbaa !21
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.Access, ptr %29, i32 0, i32 0
  store i32 %28, ptr %30, align 8, !tbaa !22
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.Access, ptr %32, i32 0, i32 1
  store ptr %31, ptr %33, align 8, !tbaa !24
  %34 = getelementptr inbounds %class.TxnManager, ptr %10, i32 0, i32 20
  %35 = load ptr, ptr %34, align 8, !tbaa !25
  %36 = getelementptr inbounds %class.Transaction, ptr %35, i32 0, i32 5
  %37 = load i64, ptr %36, align 8, !tbaa !26
  %38 = add i64 %37, 1
  store i64 %38, ptr %36, align 8, !tbaa !26
  %39 = load i32, ptr %7, align 4, !tbaa !21
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %41, label %47

41:                                               ; preds = %21
  %42 = getelementptr inbounds %class.TxnManager, ptr %10, i32 0, i32 20
  %43 = load ptr, ptr %42, align 8, !tbaa !25
  %44 = getelementptr inbounds %class.Transaction, ptr %43, i32 0, i32 4
  %45 = load i64, ptr %44, align 8, !tbaa !31
  %46 = add i64 %45, 1
  store i64 %46, ptr %44, align 8, !tbaa !31
  br label %47

47:                                               ; preds = %41, %21
  %48 = getelementptr inbounds %class.TxnManager, ptr %10, i32 0, i32 20
  %49 = load ptr, ptr %48, align 8, !tbaa !25
  %50 = getelementptr inbounds %class.Transaction, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN5ArrayIP6AccessE3addES1_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef %51)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %52 = call noundef i64 @_Z13get_sys_clockv()
  %53 = load i64, ptr %5, align 8, !tbaa !9
  %54 = sub i64 %52, %53
  store i64 %54, ptr %9, align 8, !tbaa !9
  %55 = load ptr, ptr @simulation, align 8, !tbaa !5
  %56 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %55)
  br i1 %56, label %57, label %67

57:                                               ; preds = %47
  %58 = load i64, ptr %9, align 8, !tbaa !9
  %59 = uitofp i64 %58 to double
  %60 = load ptr, ptr @stats, align 8, !tbaa !32
  %61 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %10)
  %62 = getelementptr inbounds ptr, ptr %60, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %64 = getelementptr inbounds %class.Stats_thd, ptr %63, i32 0, i32 35
  %65 = load double, ptr %64, align 8, !tbaa !34
  %66 = fadd double %65, %59
  store double %66, ptr %64, align 8, !tbaa !34
  br label %67

67:                                               ; preds = %57, %47
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %class.Access, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !38
  %71 = getelementptr inbounds %class.TxnManager, ptr %10, i32 0, i32 34
  store ptr %70, ptr %71, align 8, !tbaa !39
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %class.Access, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !38
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %74, ptr %75, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i32 0
}

declare noundef i32 @_ZN5row_t17get_row_post_waitE8access_tP10TxnManagerRPS_(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) #0

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


; 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 }
%class.AccessPool = type { ptr, ptr }

@.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
@access_pool = external global %class.AccessPool, align 8
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN10TxnManager17get_row_post_waitERP5row_t = external hidden unnamed_addr constant [43 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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

declare void @_ZN10AccessPool3getEmRP6Access(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10TxnManager17get_row_post_waitERP5row_t(ptr noundef nonnull align 8 dereferenceable(544) %0, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %1) local_unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = tail call noundef i64 @_Z13get_sys_clockv()
  %5 = getelementptr inbounds i8, ptr %0, i64 488
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %8

7:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 865, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN10TxnManager17get_row_post_waitERP5row_t) #5
  unreachable

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 504
  %10 = load i32, ptr %9, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %11 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  call void @_ZN10AccessPool3getEmRP6Access(ptr noundef nonnull align 8 dereferenceable(16) @access_pool, i64 noundef %11, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %12 = load ptr, ptr %3, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = call noundef i32 @_ZN5row_t17get_row_post_waitE8access_tP10TxnManagerRPS_(ptr noundef nonnull align 8 dereferenceable(64) %6, i32 noundef %10, ptr noundef nonnull %0, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %15 = load ptr, ptr %3, align 8, !tbaa !19
  store i32 %10, ptr %15, align 8, !tbaa !20
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  store ptr %6, ptr %16, align 8, !tbaa !22
  %17 = getelementptr inbounds i8, ptr %0, i64 136
  %18 = load ptr, ptr %17, align 8, !tbaa !23
  %19 = getelementptr inbounds i8, ptr %18, i64 56
  %20 = load i64, ptr %19, align 8, !tbaa !24
  %21 = add i64 %20, 1
  store i64 %21, ptr %19, align 8, !tbaa !24
  %22 = icmp eq i32 %10, 1
  br i1 %22, label %23, label %27

23:                                               ; preds = %8
  %24 = getelementptr inbounds i8, ptr %18, i64 48
  %25 = load i64, ptr %24, align 8, !tbaa !29
  %26 = add i64 %25, 1
  store i64 %26, ptr %24, align 8, !tbaa !29
  br label %27

27:                                               ; preds = %23, %8
  call void @_ZN5ArrayIP6AccessE3addES1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull %15)
  %28 = call noundef i64 @_Z13get_sys_clockv()
  %29 = load ptr, ptr @simulation, align 8, !tbaa !19
  %30 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %29)
  br i1 %30, label %31, label %41

31:                                               ; preds = %27
  %32 = sub i64 %28, %4
  %33 = uitofp i64 %32 to double
  %34 = load ptr, ptr @stats, align 8, !tbaa !30
  %35 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  %36 = getelementptr inbounds ptr, ptr %34, i64 %35
  %37 = load ptr, ptr %36, align 8, !tbaa !19
  %38 = getelementptr inbounds i8, ptr %37, i64 336
  %39 = load double, ptr %38, align 8, !tbaa !32
  %40 = fadd double %39, %33
  store double %40, ptr %38, align 8, !tbaa !32
  br label %41

41:                                               ; preds = %31, %27
  %42 = load ptr, ptr %3, align 8, !tbaa !19
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = load ptr, ptr %43, align 8, !tbaa !36
  %45 = getelementptr inbounds i8, ptr %0, i64 496
  store ptr %44, ptr %45, align 8, !tbaa !37
  store ptr %44, ptr %1, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 0
}

declare noundef i32 @_ZN5row_t17get_row_post_waitE8access_tP10TxnManagerRPS_(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { noreturn nounwind }
attributes #6 = { 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 488}
!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 = !{!6, !17, i64 504}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !17, i64 0}
!21 = !{!"_ZTS6Access", !17, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!22 = !{!21, !7, i64 8}
!23 = !{!6, !7, i64 136}
!24 = !{!25, !12, i64 56}
!25 = !{!"_ZTS11Transaction", !26, i64 0, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !27, i64 64, !16, i64 72, !12, i64 96, !12, i64 104, !28, i64 112}
!26 = !{!"_ZTS5ArrayIP6AccessE", !7, i64 0, !12, i64 8, !12, i64 16}
!27 = !{!"_ZTS8TxnState", !8, i64 0}
!28 = !{!"_ZTS2RC", !8, i64 0}
!29 = !{!25, !12, i64 48}
!30 = !{!31, !7, i64 0}
!31 = !{!"_ZTS5Stats", !7, i64 0, !7, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!32 = !{!33, !14, i64 336}
!33 = !{!"_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, !34, i64 1312, !34, i64 1384, !34, i64 1456, !34, 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}
!34 = !{!"_ZTS8StatsArr", !7, i64 0, !12, i64 8, !12, i64 16, !35, i64 24, !8, i64 32}
!35 = !{!"_ZTS12StatsArrType", !8, i64 0}
!36 = !{!21, !7, i64 16}
!37 = !{!6, !7, i64 496}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass