; LLVM IR from mitdbg/deneva :: concurrency_control/row_maat.ll (ZN8Row_maat6commitE8access_tP10TxnManagerP5row_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.TimeTable = type { i64, ptr, %union.sem_t }
%union.sem_t = type { i64, [24 x i8] }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.Row_maat = type { i8, ptr, ptr, 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 }
%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, 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 = type { ptr, i64, i64 }

@simulation = external global ptr, align 8
@stats = external global %class.Stats, align 8
@time_table = external global %class.TimeTable, align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

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

declare noundef i64 @_Z13get_sys_clockv() #2

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

declare noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544)) #2

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

declare noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8Row_maat6commitE8access_tP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca i64, align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca i64, align 8
  %25 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %27 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %27, ptr %9, align 8, !tbaa !11
  br label %28

28:                                               ; preds = %33, %4
  %29 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 0
  %30 = cmpxchg ptr %29, i8 1, i8 0 seq_cst seq_cst, align 8
  %31 = extractvalue { i8, i1 } %30, 1
  %32 = xor i1 %31, true
  br i1 %32, label %33, label %34

33:                                               ; preds = %28
  br label %28, !llvm.loop !13

34:                                               ; preds = %28
  %35 = load ptr, ptr @simulation, align 8, !tbaa !5
  %36 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %35)
  br i1 %36, label %37, label %52

37:                                               ; preds = %34
  %38 = call noundef i64 @_Z13get_sys_clockv()
  %39 = load i64, ptr %9, align 8, !tbaa !11
  %40 = sub i64 %38, %39
  %41 = uitofp i64 %40 to double
  %42 = load ptr, ptr @stats, align 8, !tbaa !15
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %43)
  %45 = getelementptr inbounds ptr, ptr %42, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds %class.Stats_thd, ptr %46, i32 0, i32 197
  %48 = load ptr, ptr %47, align 8, !tbaa !17
  %49 = getelementptr inbounds double, ptr %48, i64 33
  %50 = load double, ptr %49, align 8, !tbaa !22
  %51 = fadd double %50, %41
  store double %51, ptr %49, align 8, !tbaa !22
  br label %52

52:                                               ; preds = %37, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = call noundef i64 @_ZN10TxnManager20get_commit_timestampEv(ptr noundef nonnull align 8 dereferenceable(544) %53)
  store i64 %54, ptr %10, align 8, !tbaa !11
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %111

57:                                               ; preds = %52
  %58 = load i64, ptr %10, align 8, !tbaa !11
  %59 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 4
  %60 = load i64, ptr %59, align 8, !tbaa !23
  %61 = icmp ugt i64 %58, %60
  br i1 %61, label %62, label %65

62:                                               ; preds = %57
  %63 = load i64, ptr %10, align 8, !tbaa !11
  %64 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 4
  store i64 %63, ptr %64, align 8, !tbaa !23
  br label %65

65:                                               ; preds = %62, %57
  %66 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %68)
  store i64 %69, ptr %11, align 8, !tbaa !11
  %70 = call noundef i64 @_ZNSt3setImSt4lessImESaImEE5eraseERKm(ptr noundef nonnull align 8 dereferenceable(48) %67, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %71 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 3
  %72 = load ptr, ptr %71, align 8, !tbaa !27
  %73 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %72) #4
  %74 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %12, i32 0, i32 0
  store ptr %73, ptr %74, align 8
  br label %75

75:                                               ; preds = %107, %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %76 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !27
  %78 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %77) #4
  %79 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %78, ptr %79, align 8
  %80 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br i1 %80, label %82, label %81

81:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %110

82:                                               ; preds = %75
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %class.TxnManager, ptr %83, i32 0, i32 15
  %85 = load ptr, ptr %84, align 8, !tbaa !28
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  %87 = call noundef i64 @_ZNKSt3setImSt4lessImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(48) %85, ptr noundef nonnull align 8 dereferenceable(8) %86)
  %88 = icmp eq i64 %87, 0
  br i1 %88, label %89, label %106

89:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %90)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = call noundef i64 @_ZN9TimeTable9get_lowerEmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %91, i64 noundef %93)
  store i64 %94, ptr %14, align 8, !tbaa !11
  %95 = load i64, ptr %14, align 8, !tbaa !11
  %96 = load i64, ptr %10, align 8, !tbaa !11
  %97 = icmp ule i64 %95, %96
  br i1 %97, label %98, label %105

98:                                               ; preds = %89
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %99)
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  %102 = load i64, ptr %101, align 8, !tbaa !11
  %103 = load i64, ptr %10, align 8, !tbaa !11
  %104 = add i64 %103, 1
  call void @_ZN9TimeTable9set_lowerEmmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %100, i64 noundef %102, i64 noundef %104)
  br label %105

105:                                              ; preds = %98, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %106

106:                                              ; preds = %105, %82
  br label %107

107:                                              ; preds = %106
  %108 = call ptr @_ZNSt23_Rb_tree_const_iteratorImEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #4
  %109 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  br label %75, !llvm.loop !34

110:                                              ; preds = %81
  br label %111

111:                                              ; preds = %110, %52
  %112 = load i32, ptr %6, align 4, !tbaa !9
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %214

114:                                              ; preds = %111
  %115 = load i64, ptr %10, align 8, !tbaa !11
  %116 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 5
  %117 = load i64, ptr %116, align 8, !tbaa !35
  %118 = icmp ugt i64 %115, %117
  br i1 %118, label %119, label %122

119:                                              ; preds = %114
  %120 = load i64, ptr %10, align 8, !tbaa !11
  %121 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 5
  store i64 %120, ptr %121, align 8, !tbaa !35
  br label %122

122:                                              ; preds = %119, %114
  %123 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 3
  %124 = load ptr, ptr %123, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %125)
  store i64 %126, ptr %16, align 8, !tbaa !11
  %127 = call noundef i64 @_ZNSt3setImSt4lessImESaImEE5eraseERKm(ptr noundef nonnull align 8 dereferenceable(48) %124, ptr noundef nonnull align 8 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN8Row_maat5writeEP5row_t(ptr noundef nonnull align 8 dereferenceable(48) %26, ptr noundef %128)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %129)
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %131)
  %133 = call noundef i64 @_ZN9TimeTable9get_lowerEmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %130, i64 noundef %132)
  store i64 %133, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %134 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 3
  %135 = load ptr, ptr %134, align 8, !tbaa !27
  %136 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %135) #4
  %137 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %136, ptr %137, align 8
  br label %138

138:                                              ; preds = %170, %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %139 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 3
  %140 = load ptr, ptr %139, align 8, !tbaa !27
  %141 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %140) #4
  %142 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %141, ptr %142, align 8
  %143 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br i1 %143, label %145, label %144

144:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %173

145:                                              ; preds = %138
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %class.TxnManager, ptr %146, i32 0, i32 16
  %148 = load ptr, ptr %147, align 8, !tbaa !36
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  %150 = call noundef i64 @_ZNKSt3setImSt4lessImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(48) %148, ptr noundef nonnull align 8 dereferenceable(8) %149)
  %151 = icmp eq i64 %150, 0
  br i1 %151, label %152, label %169

152:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %153)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  %156 = load i64, ptr %155, align 8, !tbaa !11
  %157 = call noundef i64 @_ZN9TimeTable9get_upperEmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %154, i64 noundef %156)
  store i64 %157, ptr %20, align 8, !tbaa !11
  %158 = load i64, ptr %20, align 8, !tbaa !11
  %159 = load i64, ptr %10, align 8, !tbaa !11
  %160 = icmp uge i64 %158, %159
  br i1 %160, label %161, label %168

161:                                              ; preds = %152
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %162)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  %165 = load i64, ptr %164, align 8, !tbaa !11
  %166 = load i64, ptr %10, align 8, !tbaa !11
  %167 = sub i64 %166, 1
  call void @_ZN9TimeTable9set_upperEmmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %163, i64 noundef %165, i64 noundef %167)
  br label %168

168:                                              ; preds = %161, %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %169

169:                                              ; preds = %168, %145
  br label %170

170:                                              ; preds = %169
  %171 = call ptr @_ZNSt23_Rb_tree_const_iteratorImEppEi(ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef 0) #4
  %172 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %171, ptr %172, align 8
  br label %138, !llvm.loop !37

173:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %174 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 2
  %175 = load ptr, ptr %174, align 8, !tbaa !26
  %176 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %175) #4
  %177 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %176, ptr %177, align 8
  br label %178

178:                                              ; preds = %210, %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %179 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 2
  %180 = load ptr, ptr %179, align 8, !tbaa !26
  %181 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %180) #4
  %182 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %181, ptr %182, align 8
  %183 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  br i1 %183, label %185, label %184

184:                                              ; preds = %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %213

185:                                              ; preds = %178
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = getelementptr inbounds %class.TxnManager, ptr %186, i32 0, i32 14
  %188 = load ptr, ptr %187, align 8, !tbaa !38
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #4
  %190 = call noundef i64 @_ZNKSt3setImSt4lessImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(48) %188, ptr noundef nonnull align 8 dereferenceable(8) %189)
  %191 = icmp eq i64 %190, 0
  br i1 %191, label %192, label %209

192:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %193 = load ptr, ptr %7, align 8, !tbaa !5
  %194 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %193)
  %195 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #4
  %196 = load i64, ptr %195, align 8, !tbaa !11
  %197 = call noundef i64 @_ZN9TimeTable9get_upperEmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %194, i64 noundef %196)
  store i64 %197, ptr %24, align 8, !tbaa !11
  %198 = load i64, ptr %24, align 8, !tbaa !11
  %199 = load i64, ptr %17, align 8, !tbaa !11
  %200 = icmp uge i64 %198, %199
  br i1 %200, label %201, label %208

201:                                              ; preds = %192
  %202 = load ptr, ptr %7, align 8, !tbaa !5
  %203 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %202)
  %204 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #4
  %205 = load i64, ptr %204, align 8, !tbaa !11
  %206 = load i64, ptr %17, align 8, !tbaa !11
  %207 = sub i64 %206, 1
  call void @_ZN9TimeTable9set_upperEmmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %203, i64 noundef %205, i64 noundef %207)
  br label %208

208:                                              ; preds = %201, %192
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  br label %209

209:                                              ; preds = %208, %185
  br label %210

210:                                              ; preds = %209
  %211 = call ptr @_ZNSt23_Rb_tree_const_iteratorImEppEi(ptr noundef nonnull align 8 dereferenceable(8) %22, i32 noundef 0) #4
  %212 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  store ptr %211, ptr %212, align 8
  br label %178, !llvm.loop !39

213:                                              ; preds = %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %214

214:                                              ; preds = %213, %111
  %215 = getelementptr inbounds %class.Row_maat, ptr %26, i32 0, i32 0
  %216 = cmpxchg ptr %215, i8 0, i8 1 seq_cst seq_cst, align 8
  %217 = extractvalue { i8, i1 } %216, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

declare noundef i64 @_ZN9TimeTable9get_lowerEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) #2

declare void @_ZN9TimeTable9set_lowerEmmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef, i64 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_maat5writeEP5row_t(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) #3 align 2

declare noundef i64 @_ZN9TimeTable9get_upperEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) #2

declare void @_ZN9TimeTable9set_upperEmmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef, i64 noundef) #2

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


; 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.TimeTable = type { i64, ptr, %union.sem_t }
%union.sem_t = type { i64, [24 x i8] }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@simulation = external local_unnamed_addr global ptr, align 8
@stats = external local_unnamed_addr global %class.Stats, align 8
@time_table = external global %class.TimeTable, align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #2

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

declare noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544)) local_unnamed_addr #2

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

declare noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8Row_maat6commitE8access_tP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #3 align 2 {
  %5 = alloca i64, align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = tail call noundef i64 @_Z13get_sys_clockv()
  br label %14

14:                                               ; preds = %14, %4
  %15 = cmpxchg ptr %0, i8 1, i8 0 seq_cst seq_cst, align 8
  %16 = extractvalue { i8, i1 } %15, 1
  br i1 %16, label %17, label %14, !llvm.loop !5

17:                                               ; preds = %14
  %18 = load ptr, ptr @simulation, align 8, !tbaa !7
  %19 = tail call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %18)
  br i1 %19, label %20, label %33

20:                                               ; preds = %17
  %21 = tail call noundef i64 @_Z13get_sys_clockv()
  %22 = sub i64 %21, %13
  %23 = uitofp i64 %22 to double
  %24 = load ptr, ptr @stats, align 8, !tbaa !11
  %25 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %26 = getelementptr inbounds ptr, ptr %24, i64 %25
  %27 = load ptr, ptr %26, align 8, !tbaa !7
  %28 = getelementptr inbounds i8, ptr %27, i64 1888
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = getelementptr inbounds i8, ptr %29, i64 264
  %31 = load double, ptr %30, align 8, !tbaa !19
  %32 = fadd double %31, %23
  store double %32, ptr %30, align 8, !tbaa !19
  br label %33

33:                                               ; preds = %20, %17
  %34 = tail call noundef i64 @_ZN10TxnManager20get_commit_timestampEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  switch i32 %1, label %138 [
    i32 0, label %35
    i32 1, label %72
  ]

35:                                               ; preds = %33
  %36 = getelementptr inbounds i8, ptr %0, i64 32
  %37 = load i64, ptr %36, align 8, !tbaa !20
  %38 = icmp ugt i64 %34, %37
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  store i64 %34, ptr %36, align 8, !tbaa !20
  br label %40

40:                                               ; preds = %39, %35
  %41 = getelementptr inbounds i8, ptr %0, i64 16
  %42 = load ptr, ptr %41, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %43 = tail call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  store i64 %43, ptr %5, align 8, !tbaa !24
  %44 = call noundef i64 @_ZNSt3setImSt4lessImESaImEE5eraseERKm(ptr noundef nonnull align 8 dereferenceable(48) %42, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %45 = getelementptr inbounds i8, ptr %0, i64 24
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %47 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %46) #4
  store ptr %47, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %48 = load ptr, ptr %45, align 8, !tbaa !25
  %49 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %48) #4
  store ptr %49, ptr %7, align 8
  %50 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %40
  %51 = getelementptr inbounds i8, ptr %2, i64 104
  %52 = add i64 %34, 1
  br label %53

._crit_edge:                                      ; preds = %67, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %138

53:                                               ; preds = %.lr.ph, %67
  %54 = load ptr, ptr %51, align 8, !tbaa !26
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %56 = call noundef i64 @_ZNKSt3setImSt4lessImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(48) %54, ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %58, label %67

58:                                               ; preds = %53
  %59 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %61 = load i64, ptr %60, align 8, !tbaa !24
  %62 = call noundef i64 @_ZN9TimeTable9get_lowerEmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %59, i64 noundef %61)
  %.not36 = icmp ugt i64 %62, %34
  br i1 %.not36, label %67, label %63

63:                                               ; preds = %58
  %64 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %66 = load i64, ptr %65, align 8, !tbaa !24
  call void @_ZN9TimeTable9set_lowerEmmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %64, i64 noundef %66, i64 noundef %52)
  br label %67

67:                                               ; preds = %58, %63, %53
  %68 = call ptr @_ZNSt23_Rb_tree_const_iteratorImEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %69 = load ptr, ptr %45, align 8, !tbaa !25
  %70 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %69) #4
  store ptr %70, ptr %7, align 8
  %71 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br i1 %71, label %53, label %._crit_edge, !llvm.loop !33

72:                                               ; preds = %33
  %73 = getelementptr inbounds i8, ptr %0, i64 40
  %74 = load i64, ptr %73, align 8, !tbaa !34
  %75 = icmp ugt i64 %34, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %72
  store i64 %34, ptr %73, align 8, !tbaa !34
  br label %77

77:                                               ; preds = %76, %72
  %78 = getelementptr inbounds i8, ptr %0, i64 24
  %79 = load ptr, ptr %78, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %80 = tail call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  store i64 %80, ptr %8, align 8, !tbaa !24
  %81 = call noundef i64 @_ZNSt3setImSt4lessImESaImEE5eraseERKm(ptr noundef nonnull align 8 dereferenceable(48) %79, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @_ZN8Row_maat5writeEP5row_t(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %3)
  %82 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %83 = call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %84 = call noundef i64 @_ZN9TimeTable9get_lowerEmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %82, i64 noundef %83)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %85 = load ptr, ptr %78, align 8, !tbaa !25
  %86 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %85) #4
  store ptr %86, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %87 = load ptr, ptr %78, align 8, !tbaa !25
  %88 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %87) #4
  store ptr %88, ptr %10, align 8
  %89 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br i1 %89, label %.lr.ph38, label %._crit_edge39

.lr.ph38:                                         ; preds = %77
  %90 = getelementptr inbounds i8, ptr %2, i64 112
  %91 = add i64 %34, -1
  br label %100

._crit_edge39:                                    ; preds = %114, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %92 = getelementptr inbounds i8, ptr %0, i64 16
  %93 = load ptr, ptr %92, align 8, !tbaa !23
  %94 = call ptr @_ZNKSt3setImSt4lessImESaImEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %93) #4
  store ptr %94, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %95 = load ptr, ptr %92, align 8, !tbaa !23
  %96 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %95) #4
  store ptr %96, ptr %12, align 8
  %97 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br i1 %97, label %.lr.ph41, label %._crit_edge42

.lr.ph41:                                         ; preds = %._crit_edge39
  %98 = getelementptr inbounds i8, ptr %2, i64 96
  %99 = add i64 %84, -1
  br label %119

100:                                              ; preds = %.lr.ph38, %114
  %101 = load ptr, ptr %90, align 8, !tbaa !35
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  %103 = call noundef i64 @_ZNKSt3setImSt4lessImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(48) %101, ptr noundef nonnull align 8 dereferenceable(8) %102)
  %104 = icmp eq i64 %103, 0
  br i1 %104, label %105, label %114

105:                                              ; preds = %100
  %106 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  %108 = load i64, ptr %107, align 8, !tbaa !24
  %109 = call noundef i64 @_ZN9TimeTable9get_upperEmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %106, i64 noundef %108)
  %.not35 = icmp ult i64 %109, %34
  br i1 %.not35, label %114, label %110

110:                                              ; preds = %105
  %111 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  %113 = load i64, ptr %112, align 8, !tbaa !24
  call void @_ZN9TimeTable9set_upperEmmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %111, i64 noundef %113, i64 noundef %91)
  br label %114

114:                                              ; preds = %105, %110, %100
  %115 = call ptr @_ZNSt23_Rb_tree_const_iteratorImEppEi(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %116 = load ptr, ptr %78, align 8, !tbaa !25
  %117 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %116) #4
  store ptr %117, ptr %10, align 8
  %118 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br i1 %118, label %100, label %._crit_edge39, !llvm.loop !36

._crit_edge42:                                    ; preds = %133, %._crit_edge39
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %138

119:                                              ; preds = %.lr.ph41, %133
  %120 = load ptr, ptr %98, align 8, !tbaa !37
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %122 = call noundef i64 @_ZNKSt3setImSt4lessImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(48) %120, ptr noundef nonnull align 8 dereferenceable(8) %121)
  %123 = icmp eq i64 %122, 0
  br i1 %123, label %124, label %133

124:                                              ; preds = %119
  %125 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %127 = load i64, ptr %126, align 8, !tbaa !24
  %128 = call noundef i64 @_ZN9TimeTable9get_upperEmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %125, i64 noundef %127)
  %.not = icmp ult i64 %128, %84
  br i1 %.not, label %133, label %129

129:                                              ; preds = %124
  %130 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %2)
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorImEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %132 = load i64, ptr %131, align 8, !tbaa !24
  call void @_ZN9TimeTable9set_upperEmmm(ptr noundef nonnull align 8 dereferenceable(48) @time_table, i64 noundef %130, i64 noundef %132, i64 noundef %99)
  br label %133

133:                                              ; preds = %124, %129, %119
  %134 = call ptr @_ZNSt23_Rb_tree_const_iteratorImEppEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %135 = load ptr, ptr %92, align 8, !tbaa !23
  %136 = call ptr @_ZNKSt3setImSt4lessImESaImEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %135) #4
  store ptr %136, ptr %12, align 8
  %137 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br i1 %137, label %119, label %._crit_edge42, !llvm.loop !38

138:                                              ; preds = %._crit_edge, %33, %._crit_edge42
  %139 = cmpxchg ptr %0, i8 0, i8 1 seq_cst seq_cst, align 8
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorImES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

declare noundef i64 @_ZN9TimeTable9get_lowerEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) local_unnamed_addr #2

declare void @_ZN9TimeTable9set_lowerEmmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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

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

declare noundef i64 @_ZN9TimeTable9get_upperEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) local_unnamed_addr #2

declare void @_ZN9TimeTable9set_upperEmmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { "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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !8, i64 0}
!12 = !{!"_ZTS5Stats", !8, i64 0, !8, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!13 = !{!"long", !9, i64 0}
!14 = !{!15, !8, i64 1888}
!15 = !{!"_ZTS9Stats_thd", !9, i64 0, !8, i64 64, !8, i64 72, !16, 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, !16, i64 184, !13, i64 192, !16, i64 200, !13, i64 208, !16, i64 216, !13, i64 224, !13, 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, !13, 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, !13, i64 376, !13, i64 384, !16, i64 392, !13, i64 400, !16, i64 408, !13, i64 416, !16, i64 424, !16, i64 432, !16, i64 440, !13, i64 448, !13, i64 456, !13, 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, !13, i64 544, !8, i64 552, !8, i64 560, !16, i64 568, !13, i64 576, !13, i64 584, !16, i64 592, !16, i64 600, !16, i64 608, !13, i64 616, !13, i64 624, !13, i64 632, !13, i64 640, !13, i64 648, !13, i64 656, !13, i64 664, !16, i64 672, !16, i64 680, !16, 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, !16, i64 768, !16, i64 776, !16, i64 784, !16, i64 792, !16, i64 800, !13, i64 808, !13, i64 816, !16, i64 824, !16, i64 832, !13, i64 840, !13, i64 848, !13, i64 856, !16, i64 864, !16, i64 872, !13, i64 880, !13, i64 888, !16, i64 896, !16, i64 904, !16, i64 912, !16, i64 920, !13, i64 928, !13, i64 936, !16, i64 944, !16, i64 952, !16, i64 960, !13, i64 968, !13, i64 976, !16, i64 984, !16, i64 992, !16, i64 1000, !16, i64 1008, !16, i64 1016, !13, 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, !13, i64 1096, !13, i64 1104, !13, i64 1112, !16, i64 1120, !13, i64 1128, !16, i64 1136, !16, i64 1144, !13, i64 1152, !13, i64 1160, !13, i64 1168, !13, i64 1176, !13, i64 1184, !16, i64 1192, !13, i64 1200, !13, i64 1208, !16, i64 1216, !13, i64 1224, !16, i64 1232, !16, i64 1240, !13, i64 1248, !13, i64 1256, !13, i64 1264, !13, i64 1272, !13, i64 1280, !16, i64 1288, !16, i64 1296, !16, i64 1304, !17, i64 1312, !17, i64 1384, !17, i64 1456, !17, 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, !8, i64 1888, !9, i64 1896}
!16 = !{!"double", !9, i64 0}
!17 = !{!"_ZTS8StatsArr", !8, i64 0, !13, i64 8, !13, i64 16, !18, i64 24, !9, i64 32}
!18 = !{!"_ZTS12StatsArrType", !9, i64 0}
!19 = !{!16, !16, i64 0}
!20 = !{!21, !13, i64 32}
!21 = !{!"_ZTS8Row_maat", !22, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !13, i64 32, !13, i64 40}
!22 = !{!"bool", !9, i64 0}
!23 = !{!21, !8, i64 16}
!24 = !{!13, !13, i64 0}
!25 = !{!21, !8, i64 24}
!26 = !{!27, !8, i64 104}
!27 = !{!"_ZTS10TxnManager", !8, i64 8, !8, i64 16, !22, i64 24, !8, i64 32, !28, i64 40, !22, i64 44, !28, i64 48, !28, i64 52, !22, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !8, i64 96, !8, i64 104, !8, i64 112, !13, i64 120, !22, i64 128, !22, i64 129, !8, i64 136, !8, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !29, i64 176, !28, i64 432, !28, i64 436, !28, i64 440, !22, i64 444, !30, i64 448, !31, i64 456, !28, i64 480, !8, i64 488, !8, i64 496, !32, i64 504, !9, i64 512}
!28 = !{!"int", !9, i64 0}
!29 = !{!"_ZTS8TxnStats", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, 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, !13, i64 176, !13, 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}
!30 = !{!"_ZTS12CALVIN_PHASE", !9, i64 0}
!31 = !{!"_ZTS5ArrayIP5row_tE", !8, i64 0, !13, i64 8, !13, i64 16}
!32 = !{!"_ZTS8access_t", !9, i64 0}
!33 = distinct !{!33, !6}
!34 = !{!21, !13, i64 40}
!35 = !{!27, !8, i64 112}
!36 = distinct !{!36, !6}
!37 = !{!27, !8, i64 96}
!38 = distinct !{!38, !6}


; Effective O3 passes: ConstraintEliminationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass