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

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

@simulation = external global ptr, align 8
@stats = external global %class.Stats, align 8
@g_node_cnt = external global i32, align 4
@g_node_id = external global i32, align 4
@warmup_done = external global i8, align 1

declare noundef i64 @_Z13get_sys_clockv() #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8TxnStats11abort_statsEm(ptr noundef nonnull align 8 dereferenceable(256), i64 noundef) #1 align 2

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)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10TxnManager5abortEv(ptr noundef nonnull align 8 dereferenceable(544) %0) #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = getelementptr inbounds %class.TxnManager, ptr %5, i32 0, i32 9
  %7 = load i8, ptr %6, align 8, !tbaa !9, !range !19, !noundef !20
  %8 = trunc i8 %7 to i1
  br i1 %8, label %9, label %10

9:                                                ; preds = %1
  store i32 2, ptr %2, align 4
  br label %91

10:                                               ; preds = %1
  %11 = getelementptr inbounds %class.TxnManager, ptr %5, i32 0, i32 20
  %12 = load ptr, ptr %11, align 8, !tbaa !21
  %13 = getelementptr inbounds %class.Transaction, ptr %12, i32 0, i32 11
  store i32 2, ptr %13, align 8, !tbaa !22
  %14 = load ptr, ptr @simulation, align 8, !tbaa !5
  %15 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %14)
  br i1 %15, label %16, label %24

16:                                               ; preds = %10
  %17 = load ptr, ptr @stats, align 8, !tbaa !27
  %18 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %5)
  %19 = getelementptr inbounds ptr, ptr %17, i64 %18
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.Stats_thd, ptr %20, i32 0, i32 12
  %22 = load i64, ptr %21, align 8, !tbaa !29
  %23 = add i64 %22, 1
  store i64 %23, ptr %21, align 8, !tbaa !29
  br label %24

24:                                               ; preds = %16, %10
  %25 = getelementptr inbounds %class.TxnManager, ptr %5, i32 0, i32 25
  %26 = getelementptr inbounds %class.TxnStats, ptr %25, i32 0, i32 4
  %27 = load i64, ptr %26, align 8, !tbaa !33
  %28 = add i64 %27, 1
  store i64 %28, ptr %26, align 8, !tbaa !33
  %29 = call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %5)
  %30 = load i32, ptr @g_node_cnt, align 4, !tbaa !34
  %31 = zext i32 %30 to i64
  %32 = urem i64 %29, %31
  %33 = load i32, ptr @g_node_id, align 4, !tbaa !34
  %34 = zext i32 %33 to i64
  %35 = icmp eq i64 %32, %34
  br i1 %35, label %36, label %48

36:                                               ; preds = %24
  %37 = load ptr, ptr @simulation, align 8, !tbaa !5
  %38 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %37)
  br i1 %38, label %39, label %47

39:                                               ; preds = %36
  %40 = load ptr, ptr @stats, align 8, !tbaa !27
  %41 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %5)
  %42 = getelementptr inbounds ptr, ptr %40, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = getelementptr inbounds %class.Stats_thd, ptr %43, i32 0, i32 14
  %45 = load i64, ptr %44, align 8, !tbaa !35
  %46 = add i64 %45, 1
  store i64 %46, ptr %44, align 8, !tbaa !35
  br label %47

47:                                               ; preds = %39, %36
  br label %62

48:                                               ; preds = %24
  %49 = load ptr, ptr @simulation, align 8, !tbaa !5
  %50 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %49)
  br i1 %50, label %51, label %59

51:                                               ; preds = %48
  %52 = load ptr, ptr @stats, align 8, !tbaa !27
  %53 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %5)
  %54 = getelementptr inbounds ptr, ptr %52, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = getelementptr inbounds %class.Stats_thd, ptr %55, i32 0, i32 15
  %57 = load i64, ptr %56, align 8, !tbaa !36
  %58 = add i64 %57, 1
  store i64 %58, ptr %56, align 8, !tbaa !36
  br label %59

59:                                               ; preds = %51, %48
  %60 = getelementptr inbounds %class.TxnManager, ptr %5, i32 0, i32 25
  %61 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %5)
  call void @_ZN8TxnStats11abort_statsEm(ptr noundef nonnull align 8 dereferenceable(256) %60, i64 noundef %61)
  br label %62

62:                                               ; preds = %59, %47
  %63 = getelementptr inbounds %class.TxnManager, ptr %5, i32 0, i32 9
  store i8 1, ptr %63, align 8, !tbaa !9
  call void @_ZN10TxnManager13release_locksE2RC(ptr noundef nonnull align 8 dereferenceable(544) %5, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %64 = call noundef i64 @_Z13get_sys_clockv()
  %65 = getelementptr inbounds %class.TxnManager, ptr %5, i32 0, i32 25
  %66 = getelementptr inbounds %class.TxnStats, ptr %65, i32 0, i32 1
  %67 = load i64, ptr %66, align 8, !tbaa !37
  %68 = sub i64 %64, %67
  store i64 %68, ptr %4, align 8, !tbaa !38
  %69 = call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %5)
  %70 = load i32, ptr @g_node_cnt, align 4, !tbaa !34
  %71 = zext i32 %70 to i64
  %72 = urem i64 %69, %71
  %73 = load i32, ptr @g_node_id, align 4, !tbaa !34
  %74 = zext i32 %73 to i64
  %75 = icmp eq i64 %72, %74
  br i1 %75, label %76, label %90

76:                                               ; preds = %62
  %77 = load volatile i8, ptr @warmup_done, align 1, !tbaa !39, !range !19, !noundef !20
  %78 = trunc i8 %77 to i1
  br i1 %78, label %79, label %90

79:                                               ; preds = %76
  %80 = load ptr, ptr @simulation, align 8, !tbaa !5
  %81 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %80)
  br i1 %81, label %82, label %89

82:                                               ; preds = %79
  %83 = load ptr, ptr @stats, align 8, !tbaa !27
  %84 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %5)
  %85 = getelementptr inbounds ptr, ptr %83, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds %class.Stats_thd, ptr %86, i32 0, i32 160
  %88 = load i64, ptr %4, align 8, !tbaa !38
  call void @_ZN8StatsArr6insertEm(ptr noundef nonnull align 8 dereferenceable(72) %87, i64 noundef %88)
  br label %89

89:                                               ; preds = %82, %79
  br label %90

90:                                               ; preds = %89, %76, %62
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %91

91:                                               ; preds = %90, %9
  %92 = load i32, ptr %2, align 4
  ret i32 %92
}

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

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

@simulation = external local_unnamed_addr global ptr, align 8
@stats = external local_unnamed_addr global %class.Stats, align 8
@g_node_cnt = external local_unnamed_addr global i32, align 4
@g_node_id = external local_unnamed_addr global i32, align 4
@warmup_done = external global i8, align 1

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #0

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10TxnManager5abortEv(ptr noundef nonnull align 8 dereferenceable(544) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 56
  %3 = load i8, ptr %2, align 8, !tbaa !5, !range !18, !noundef !19
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %77, label %5

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 136
  %7 = load ptr, ptr %6, align 8, !tbaa !20
  %8 = getelementptr inbounds i8, ptr %7, i64 112
  store i32 2, ptr %8, align 8, !tbaa !21
  %9 = load ptr, ptr @simulation, align 8, !tbaa !26
  %10 = tail call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %9)
  br i1 %10, label %11, label %19

11:                                               ; preds = %5
  %12 = load ptr, ptr @stats, align 8, !tbaa !27
  %13 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  %14 = getelementptr inbounds ptr, ptr %12, i64 %13
  %15 = load ptr, ptr %14, align 8, !tbaa !26
  %16 = getelementptr inbounds i8, ptr %15, i64 152
  %17 = load i64, ptr %16, align 8, !tbaa !29
  %18 = add i64 %17, 1
  store i64 %18, ptr %16, align 8, !tbaa !29
  br label %19

19:                                               ; preds = %11, %5
  %20 = getelementptr inbounds i8, ptr %0, i64 176
  %21 = getelementptr inbounds i8, ptr %0, i64 208
  %22 = load i64, ptr %21, align 8, !tbaa !33
  %23 = add i64 %22, 1
  store i64 %23, ptr %21, align 8, !tbaa !33
  %24 = tail call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  %25 = load i32, ptr @g_node_cnt, align 4, !tbaa !34
  %26 = zext i32 %25 to i64
  %27 = urem i64 %24, %26
  %28 = load i32, ptr @g_node_id, align 4, !tbaa !34
  %29 = zext i32 %28 to i64
  %30 = icmp eq i64 %27, %29
  %31 = load ptr, ptr @simulation, align 8, !tbaa !26
  %32 = tail call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %31)
  br i1 %30, label %33, label %42

33:                                               ; preds = %19
  br i1 %32, label %34, label %53

34:                                               ; preds = %33
  %35 = load ptr, ptr @stats, align 8, !tbaa !27
  %36 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  %37 = getelementptr inbounds ptr, ptr %35, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !26
  %39 = getelementptr inbounds i8, ptr %38, i64 168
  %40 = load i64, ptr %39, align 8, !tbaa !35
  %41 = add i64 %40, 1
  store i64 %41, ptr %39, align 8, !tbaa !35
  br label %53

42:                                               ; preds = %19
  br i1 %32, label %43, label %51

43:                                               ; preds = %42
  %44 = load ptr, ptr @stats, align 8, !tbaa !27
  %45 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  %46 = getelementptr inbounds ptr, ptr %44, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !26
  %48 = getelementptr inbounds i8, ptr %47, i64 176
  %49 = load i64, ptr %48, align 8, !tbaa !36
  %50 = add i64 %49, 1
  store i64 %50, ptr %48, align 8, !tbaa !36
  br label %51

51:                                               ; preds = %43, %42
  %52 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  tail call void @_ZN8TxnStats11abort_statsEm(ptr noundef nonnull align 8 dereferenceable(256) %20, i64 noundef %52)
  br label %53

53:                                               ; preds = %33, %34, %51
  store i8 1, ptr %2, align 8, !tbaa !5
  tail call void @_ZN10TxnManager13release_locksE2RC(ptr noundef nonnull align 8 dereferenceable(544) %0, i32 noundef 2)
  %54 = tail call noundef i64 @_Z13get_sys_clockv()
  %55 = getelementptr inbounds i8, ptr %0, i64 184
  %56 = load i64, ptr %55, align 8, !tbaa !37
  %57 = sub i64 %54, %56
  %58 = tail call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  %59 = load i32, ptr @g_node_cnt, align 4, !tbaa !34
  %60 = zext i32 %59 to i64
  %61 = urem i64 %58, %60
  %62 = load i32, ptr @g_node_id, align 4, !tbaa !34
  %63 = zext i32 %62 to i64
  %64 = icmp eq i64 %61, %63
  br i1 %64, label %65, label %77

65:                                               ; preds = %53
  %66 = load volatile i8, ptr @warmup_done, align 1, !tbaa !38, !range !18, !noundef !19
  %67 = trunc nuw i8 %66 to i1
  br i1 %67, label %68, label %77

68:                                               ; preds = %65
  %69 = load ptr, ptr @simulation, align 8, !tbaa !26
  %70 = tail call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %69)
  br i1 %70, label %71, label %77

71:                                               ; preds = %68
  %72 = load ptr, ptr @stats, align 8, !tbaa !27
  %73 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %0)
  %74 = getelementptr inbounds ptr, ptr %72, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !26
  %76 = getelementptr inbounds i8, ptr %75, i64 1528
  tail call void @_ZN8StatsArr6insertEm(ptr noundef nonnull align 8 dereferenceable(72) %76, i64 noundef %57)
  br label %77

77:                                               ; preds = %53, %65, %71, %68, %1
  ret i32 2
}

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

declare void @_ZN8StatsArr6insertEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) 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 = { 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 #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" }

!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 56}
!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 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!6, !7, i64 136}
!21 = !{!22, !25, i64 112}
!22 = !{!"_ZTS11Transaction", !23, i64 0, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !24, i64 64, !16, i64 72, !12, i64 96, !12, i64 104, !25, i64 112}
!23 = !{!"_ZTS5ArrayIP6AccessE", !7, i64 0, !12, i64 8, !12, i64 16}
!24 = !{!"_ZTS8TxnState", !8, i64 0}
!25 = !{!"_ZTS2RC", !8, i64 0}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !7, i64 0}
!28 = !{!"_ZTS5Stats", !7, i64 0, !7, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!29 = !{!30, !12, i64 152}
!30 = !{!"_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, !31, i64 1312, !31, i64 1384, !31, i64 1456, !31, 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}
!31 = !{!"_ZTS8StatsArr", !7, i64 0, !12, i64 8, !12, i64 16, !32, i64 24, !8, i64 32}
!32 = !{!"_ZTS12StatsArrType", !8, i64 0}
!33 = !{!6, !12, i64 208}
!34 = !{!11, !11, i64 0}
!35 = !{!30, !12, i64 168}
!36 = !{!30, !12, i64 176}
!37 = !{!6, !12, i64 184}
!38 = !{!10, !10, i64 0}


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