; LLVM IR from mitdbg/deneva :: concurrency_control/row_mvcc.ll (ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_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.Manager = type { %union.pthread_mutex_t, i64, [31 x %union.pthread_mutex_t], ptr, ptr, i64, i64 }
%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.Row_mvcc = type { ptr, i8, ptr, ptr, ptr, ptr, ptr, 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, 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 }
%union.sem_t = type { i64, [24 x i8] }
%struct.MVHisEntry = type { i64, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@g_central_man = external global i8, align 1
@glob_manager = external global %class.Manager, align 8
@g_max_read_req = external global i64, align 8
@.str.9 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t = external hidden unnamed_addr constant [51 x i8], align 1
@g_max_pre_req = external global i64, align 8
@g_his_recycle_len = external global i64, align 8
@.str.11 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN8Row_mvcc13clear_historyE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, i64 noundef) #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_mvcc16return_req_entryEP10MVReqEntry(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_mvcc10buffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, ptr noundef) #0 align 2

declare noundef i64 @_ZN10TxnManager13get_timestampEv(ptr noundef nonnull align 8 dereferenceable(544)) #3

declare noundef i64 @_Z13get_sys_clockv() #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_mvcc14insert_historyEmP5row_t(ptr noundef nonnull align 8 dereferenceable(104), i64 noundef, ptr noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8Row_mvcc8conflictE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef i64 @_ZN10TxnManager13get_timestampEv(ptr noundef nonnull align 8 dereferenceable(544) %21)
  store i64 %22, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %23 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %23, ptr %11, align 8, !tbaa !13
  %24 = load i8, ptr @g_central_man, align 1, !tbaa !15, !range !17, !noundef !18
  %25 = trunc i8 %24 to i1
  br i1 %25, label %26, label %29

26:                                               ; preds = %4
  %27 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  call void @_ZN7Manager8lock_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, ptr noundef %28)
  br label %33

29:                                               ; preds = %4
  %30 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %32 = call i32 @pthread_mutex_lock(ptr noundef %31) #7
  br label %33

33:                                               ; preds = %29, %26
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %106

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = load i64, ptr %10, align 8, !tbaa !13
  %39 = call noundef zeroext i1 @_ZN8Row_mvcc8conflictE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104) %20, i32 noundef %37, i64 noundef %38)
  %40 = zext i1 %39 to i8
  store i8 %40, ptr %12, align 1, !tbaa !15
  %41 = load i8, ptr %12, align 1, !tbaa !15, !range !17, !noundef !18
  %42 = trunc i8 %41 to i1
  br i1 %42, label %43, label %52

43:                                               ; preds = %36
  %44 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 11
  %45 = load i64, ptr %44, align 8, !tbaa !22
  %46 = load i64, ptr @g_max_read_req, align 8, !tbaa !13
  %47 = icmp ult i64 %45, %46
  br i1 %47, label %48, label %52

48:                                               ; preds = %43
  store i32 3, ptr %9, align 4, !tbaa !11
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN8Row_mvcc10buffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %20, i32 noundef 0, ptr noundef %49)
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %class.TxnManager, ptr %50, i32 0, i32 6
  store volatile i8 0, ptr %51, align 4, !tbaa !23
  br label %105

52:                                               ; preds = %43, %36
  %53 = load i8, ptr %12, align 1, !tbaa !15, !range !17, !noundef !18
  %54 = trunc i8 %53 to i1
  br i1 %54, label %55, label %59

55:                                               ; preds = %52
  store i32 2, ptr %9, align 4, !tbaa !11
  %56 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 11
  %57 = load i64, ptr %56, align 8, !tbaa !22
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %57)
  br label %104

59:                                               ; preds = %52
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %60 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 6
  %61 = load ptr, ptr %60, align 8, !tbaa !31
  store ptr %61, ptr %13, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %73, %59
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %71

65:                                               ; preds = %62
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.MVHisEntry, ptr %66, i32 0, i32 0
  %68 = load i64, ptr %67, align 8, !tbaa !32
  %69 = load i64, ptr %10, align 8, !tbaa !13
  %70 = icmp ugt i64 %68, %69
  br label %71

71:                                               ; preds = %65, %62
  %72 = phi i1 [ false, %62 ], [ %70, %65 ]
  br i1 %72, label %73, label %77

73:                                               ; preds = %71
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.MVHisEntry, ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !34
  store ptr %76, ptr %13, align 8, !tbaa !5
  br label %62, !llvm.loop !35

77:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = icmp eq ptr %78, null
  br i1 %79, label %80, label %83

80:                                               ; preds = %77
  %81 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 2
  %82 = load ptr, ptr %81, align 8, !tbaa !19
  br label %87

83:                                               ; preds = %77
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.MVHisEntry, ptr %84, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !37
  br label %87

87:                                               ; preds = %83, %80
  %88 = phi ptr [ %82, %80 ], [ %86, %83 ]
  store ptr %88, ptr %14, align 8, !tbaa !5
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %class.TxnManager, ptr %90, i32 0, i32 4
  store volatile ptr %89, ptr %91, align 8, !tbaa !38
  %92 = load i64, ptr %10, align 8, !tbaa !13
  call void @_ZN8Row_mvcc14insert_historyEmP5row_t(ptr noundef nonnull align 8 dereferenceable(104) %20, i64 noundef %92, ptr noundef null)
  %93 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = call noundef ptr @_ZN5row_t14get_table_nameEv(ptr noundef nonnull align 8 dereferenceable(64) %94)
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = call noundef ptr @_ZN5row_t14get_table_nameEv(ptr noundef nonnull align 8 dereferenceable(64) %96)
  %98 = call noundef ptr @strstr(ptr noundef %95, ptr noundef %97) #8
  %99 = icmp ne ptr %98, null
  br i1 %99, label %100, label %101

100:                                              ; preds = %87
  br label %103

101:                                              ; preds = %87
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 273, ptr noundef @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

102:                                              ; No predecessors!
  br label %103

103:                                              ; preds = %102, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %104

104:                                              ; preds = %103, %55
  br label %105

105:                                              ; preds = %104, %48
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  br label %158

106:                                              ; preds = %33
  %107 = load i32, ptr %7, align 4, !tbaa !9
  %108 = icmp eq i32 %107, 2
  br i1 %108, label %109, label %124

109:                                              ; preds = %106
  %110 = load i32, ptr %7, align 4, !tbaa !9
  %111 = load i64, ptr %10, align 8, !tbaa !13
  %112 = call noundef zeroext i1 @_ZN8Row_mvcc8conflictE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104) %20, i32 noundef %110, i64 noundef %111)
  br i1 %112, label %113, label %114

113:                                              ; preds = %109
  store i32 2, ptr %9, align 4, !tbaa !11
  br label %123

114:                                              ; preds = %109
  %115 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 12
  %116 = load i64, ptr %115, align 8, !tbaa !39
  %117 = load i64, ptr @g_max_pre_req, align 8, !tbaa !13
  %118 = icmp ult i64 %116, %117
  br i1 %118, label %119, label %121

119:                                              ; preds = %114
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN8Row_mvcc10buffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %20, i32 noundef 2, ptr noundef %120)
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %122

121:                                              ; preds = %114
  store i32 2, ptr %9, align 4, !tbaa !11
  br label %122

122:                                              ; preds = %121, %119
  br label %123

123:                                              ; preds = %122, %113
  br label %157

124:                                              ; preds = %106
  %125 = load i32, ptr %7, align 4, !tbaa !9
  %126 = icmp eq i32 %125, 1
  br i1 %126, label %127, label %140

127:                                              ; preds = %124
  store i32 0, ptr %9, align 4, !tbaa !11
  %128 = load i64, ptr %10, align 8, !tbaa !13
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN8Row_mvcc14insert_historyEmP5row_t(ptr noundef nonnull align 8 dereferenceable(104) %20, i64 noundef %128, ptr noundef %129)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = call noundef ptr @_ZN8Row_mvcc12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %20, i32 noundef 2, ptr noundef %130)
  store ptr %131, ptr %15, align 8, !tbaa !5
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %135

134:                                              ; preds = %127
  br label %137

135:                                              ; preds = %127
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 291, ptr noundef @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

136:                                              ; No predecessors!
  br label %137

137:                                              ; preds = %136, %134
  %138 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZN8Row_mvcc16return_req_entryEP10MVReqEntry(ptr noundef nonnull align 8 dereferenceable(104) %20, ptr noundef %138)
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN8Row_mvcc13update_bufferEP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %20, ptr noundef %139)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %156

140:                                              ; preds = %124
  %141 = load i32, ptr %7, align 4, !tbaa !9
  %142 = icmp eq i32 %141, 3
  br i1 %142, label %143, label %154

143:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = call noundef ptr @_ZN8Row_mvcc12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %20, i32 noundef 2, ptr noundef %144)
  store ptr %145, ptr %16, align 8, !tbaa !5
  %146 = load ptr, ptr %16, align 8, !tbaa !5
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %149

148:                                              ; preds = %143
  br label %151

149:                                              ; preds = %143
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 297, ptr noundef @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

150:                                              ; No predecessors!
  br label %151

151:                                              ; preds = %150, %148
  %152 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN8Row_mvcc16return_req_entryEP10MVReqEntry(ptr noundef nonnull align 8 dereferenceable(104) %20, ptr noundef %152)
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN8Row_mvcc13update_bufferEP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %20, ptr noundef %153)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %155

154:                                              ; preds = %140
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 301, ptr noundef @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

155:                                              ; preds = %151
  br label %156

156:                                              ; preds = %155, %137
  br label %157

157:                                              ; preds = %156, %123
  br label %158

158:                                              ; preds = %157, %105
  %159 = load i32, ptr %9, align 4, !tbaa !11
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %161, label %221

161:                                              ; preds = %158
  %162 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 9
  %163 = load i64, ptr %162, align 8, !tbaa !40
  %164 = load i64, ptr @g_his_recycle_len, align 8, !tbaa !13
  %165 = icmp ugt i64 %163, %164
  br i1 %165, label %171, label %166

166:                                              ; preds = %161
  %167 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 10
  %168 = load i64, ptr %167, align 8, !tbaa !41
  %169 = load i64, ptr @g_his_recycle_len, align 8, !tbaa !13
  %170 = icmp ugt i64 %168, %169
  br i1 %170, label %171, label %220

171:                                              ; preds = %166, %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %172)
  %174 = call noundef i64 @_ZN7Manager10get_min_tsEm(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, i64 noundef %173)
  store i64 %174, ptr %17, align 8, !tbaa !13
  %175 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 7
  %176 = load ptr, ptr %175, align 8, !tbaa !42
  %177 = icmp ne ptr %176, null
  br i1 %177, label %178, label %188

178:                                              ; preds = %171
  %179 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 7
  %180 = load ptr, ptr %179, align 8, !tbaa !42
  %181 = getelementptr inbounds %struct.MVHisEntry, ptr %180, i32 0, i32 0
  %182 = load i64, ptr %181, align 8, !tbaa !32
  %183 = load i64, ptr %17, align 8, !tbaa !13
  %184 = icmp ult i64 %182, %183
  br i1 %184, label %185, label %188

185:                                              ; preds = %178
  %186 = load i64, ptr %17, align 8, !tbaa !13
  %187 = call noundef ptr @_ZN8Row_mvcc13clear_historyE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104) %20, i32 noundef 0, i64 noundef %186)
  br label %188

188:                                              ; preds = %185, %178, %171
  %189 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 9
  %190 = load i64, ptr %189, align 8, !tbaa !40
  %191 = icmp ugt i64 %190, 1
  br i1 %191, label %192, label %219

192:                                              ; preds = %188
  %193 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 8
  %194 = load ptr, ptr %193, align 8, !tbaa !43
  %195 = getelementptr inbounds %struct.MVHisEntry, ptr %194, i32 0, i32 3
  %196 = load ptr, ptr %195, align 8, !tbaa !44
  %197 = getelementptr inbounds %struct.MVHisEntry, ptr %196, i32 0, i32 0
  %198 = load i64, ptr %197, align 8, !tbaa !32
  %199 = load i64, ptr %17, align 8, !tbaa !13
  %200 = icmp ult i64 %198, %199
  br i1 %200, label %201, label %219

201:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %202 = load i64, ptr %17, align 8, !tbaa !13
  %203 = call noundef ptr @_ZN8Row_mvcc13clear_historyE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104) %20, i32 noundef 1, i64 noundef %202)
  store ptr %203, ptr %18, align 8, !tbaa !5
  %204 = load ptr, ptr %18, align 8, !tbaa !5
  %205 = icmp ne ptr %204, null
  br i1 %205, label %206, label %218

206:                                              ; preds = %201
  %207 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 2
  %208 = load ptr, ptr %207, align 8, !tbaa !19
  %209 = load ptr, ptr %18, align 8, !tbaa !5
  %210 = icmp ne ptr %208, %209
  br i1 %210, label %211, label %212

211:                                              ; preds = %206
  br label %214

212:                                              ; preds = %206
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 317, ptr noundef @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

213:                                              ; No predecessors!
  br label %214

214:                                              ; preds = %213, %211
  %215 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 2
  %216 = load ptr, ptr %215, align 8, !tbaa !19
  %217 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %216, ptr noundef %217)
  br label %218

218:                                              ; preds = %214, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %219

219:                                              ; preds = %218, %192, %188
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %220

220:                                              ; preds = %219, %166
  br label %221

221:                                              ; preds = %220, %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %222 = call noundef i64 @_Z13get_sys_clockv()
  %223 = load i64, ptr %11, align 8, !tbaa !13
  %224 = sub i64 %222, %223
  store i64 %224, ptr %19, align 8, !tbaa !13
  %225 = load i64, ptr %19, align 8, !tbaa !13
  %226 = uitofp i64 %225 to double
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %class.TxnManager, ptr %227, i32 0, i32 25
  %229 = getelementptr inbounds %class.TxnStats, ptr %228, i32 0, i32 21
  %230 = load double, ptr %229, align 8, !tbaa !45
  %231 = fadd double %230, %226
  store double %231, ptr %229, align 8, !tbaa !45
  %232 = load i64, ptr %19, align 8, !tbaa !13
  %233 = uitofp i64 %232 to double
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = getelementptr inbounds %class.TxnManager, ptr %234, i32 0, i32 25
  %236 = getelementptr inbounds %class.TxnStats, ptr %235, i32 0, i32 26
  %237 = load double, ptr %236, align 8, !tbaa !46
  %238 = fadd double %237, %233
  store double %238, ptr %236, align 8, !tbaa !46
  %239 = load i8, ptr @g_central_man, align 1, !tbaa !15, !range !17, !noundef !18
  %240 = trunc i8 %239 to i1
  br i1 %240, label %241, label %244

241:                                              ; preds = %221
  %242 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 2
  %243 = load ptr, ptr %242, align 8, !tbaa !19
  call void @_ZN7Manager11release_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, ptr noundef %243)
  br label %248

244:                                              ; preds = %221
  %245 = getelementptr inbounds %class.Row_mvcc, ptr %20, i32 0, i32 0
  %246 = load ptr, ptr %245, align 8, !tbaa !21
  %247 = call i32 @pthread_mutex_unlock(ptr noundef %246) #7
  br label %248

248:                                              ; preds = %244, %241
  %249 = load i32, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  ret i32 %249
}

declare void @_ZN7Manager8lock_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320), ptr noundef) #3

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) #5

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind willreturn memory(read)
declare noundef ptr @strstr(ptr noundef, ptr noundef) #6

declare noundef ptr @_ZN5row_t14get_table_nameEv(ptr noundef nonnull align 8 dereferenceable(64)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_mvcc13update_bufferEP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) #0 align 2

declare noundef i64 @_ZN7Manager10get_min_tsEm(ptr noundef nonnull align 8 dereferenceable(1320), i64 noundef) #3

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

declare void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef) #3

declare void @_ZN7Manager11release_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320), ptr noundef) #3

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) #5

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 "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 #6 = { nounwind willreturn memory(read) "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!"_ZTS6TsType", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS2RC", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !6, i64 16}
!20 = !{!"_ZTS8Row_mvcc", !6, i64 0, !16, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96}
!21 = !{!20, !6, i64 0}
!22 = !{!20, !14, i64 88}
!23 = !{!24, !16, i64 44}
!24 = !{!"_ZTS10TxnManager", !6, i64 8, !6, i64 16, !16, i64 24, !6, i64 32, !25, i64 40, !16, i64 44, !25, i64 48, !25, i64 52, !16, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !14, i64 120, !16, i64 128, !16, i64 129, !6, i64 136, !6, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !26, i64 176, !25, i64 432, !25, i64 436, !25, i64 440, !16, i64 444, !28, i64 448, !29, i64 456, !25, i64 480, !6, i64 488, !6, i64 496, !30, i64 504, !7, i64 512}
!25 = !{!"int", !7, i64 0}
!26 = !{!"_ZTS8TxnStats", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !27, i64 40, !27, i64 48, !27, i64 56, !27, i64 64, !27, i64 72, !27, i64 80, !27, i64 88, !27, i64 96, !27, i64 104, !27, i64 112, !27, i64 120, !27, i64 128, !27, i64 136, !27, i64 144, !27, i64 152, !27, i64 160, !27, i64 168, !14, i64 176, !14, i64 184, !27, i64 192, !27, i64 200, !27, i64 208, !27, i64 216, !27, i64 224, !27, i64 232, !27, i64 240, !27, i64 248}
!27 = !{!"double", !7, i64 0}
!28 = !{!"_ZTS12CALVIN_PHASE", !7, i64 0}
!29 = !{!"_ZTS5ArrayIP5row_tE", !6, i64 0, !14, i64 8, !14, i64 16}
!30 = !{!"_ZTS8access_t", !7, i64 0}
!31 = !{!20, !6, i64 48}
!32 = !{!33, !14, i64 0}
!33 = !{!"_ZTS10MVHisEntry", !14, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!33, !6, i64 16}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!33, !6, i64 8}
!38 = !{!24, !6, i64 32}
!39 = !{!20, !14, i64 96}
!40 = !{!20, !14, i64 72}
!41 = !{!20, !14, i64 80}
!42 = !{!20, !6, i64 56}
!43 = !{!20, !6, i64 64}
!44 = !{!33, !6, i64 24}
!45 = !{!24, !27, i64 344}
!46 = !{!24, !27, i64 384}


; 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.Manager = type { %union.pthread_mutex_t, i64, [31 x %union.pthread_mutex_t], ptr, ptr, i64, i64 }
%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 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@g_central_man = external local_unnamed_addr global i8, align 1
@glob_manager = external global %class.Manager, align 8
@g_max_read_req = external local_unnamed_addr global i64, align 8
@.str.9 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t = external hidden unnamed_addr constant [51 x i8], align 1
@g_max_pre_req = external local_unnamed_addr global i64, align 8
@g_his_recycle_len = external local_unnamed_addr global i64, align 8
@.str.11 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN8Row_mvcc13clear_historyE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_mvcc16return_req_entryEP10MVReqEntry(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_mvcc10buffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, ptr noundef) local_unnamed_addr #0 align 2

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

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_mvcc14insert_historyEmP5row_t(ptr noundef nonnull align 8 dereferenceable(104), i64 noundef, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8Row_mvcc8conflictE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 4) i32 @_ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 align 2 {
  %5 = tail call noundef i64 @_ZN10TxnManager13get_timestampEv(ptr noundef nonnull align 8 dereferenceable(544) %1)
  %6 = tail call noundef i64 @_Z13get_sys_clockv()
  %7 = load i8, ptr @g_central_man, align 1, !tbaa !5, !range !9, !noundef !10
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %9, label %12

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  tail call void @_ZN7Manager8lock_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, ptr noundef %11)
  br label %15

12:                                               ; preds = %4
  %13 = load ptr, ptr %0, align 8, !tbaa !15
  %14 = tail call i32 @pthread_mutex_lock(ptr noundef %13) #7
  br label %15

15:                                               ; preds = %12, %9
  switch i32 %2, label %59 [
    i32 0, label %16
    i32 2, label %43
    i32 1, label %51
    i32 3, label %55
  ]

16:                                               ; preds = %15
  %17 = tail call noundef zeroext i1 @_ZN8Row_mvcc8conflictE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 0, i64 noundef %5)
  br i1 %17, label %18, label %.critedge67

18:                                               ; preds = %16
  %19 = getelementptr inbounds i8, ptr %0, i64 88
  %20 = load i64, ptr %19, align 8, !tbaa !16
  %21 = load i64, ptr @g_max_read_req, align 8, !tbaa !17
  %22 = icmp ult i64 %20, %21
  br i1 %22, label %23, label %25

23:                                               ; preds = %18
  tail call void @_ZN8Row_mvcc10buffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 0, ptr noundef nonnull %1)
  %24 = getelementptr inbounds i8, ptr %1, i64 44
  store volatile i8 0, ptr %24, align 4, !tbaa !18
  br label %95

25:                                               ; preds = %18
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i64 noundef %20)
  br label %95

.critedge67:                                      ; preds = %16
  %27 = getelementptr inbounds i8, ptr %0, i64 48
  %.04974 = load ptr, ptr %27, align 8, !tbaa !26
  %cond75 = icmp eq ptr %.04974, null
  br i1 %cond75, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.critedge67, %30
  %.04976 = phi ptr [ %.049, %30 ], [ %.04974, %.critedge67 ]
  %28 = load i64, ptr %.04976, align 8, !tbaa !27
  %29 = icmp ugt i64 %28, %5
  br i1 %29, label %30, label %.critedge

30:                                               ; preds = %.lr.ph
  %31 = getelementptr inbounds i8, ptr %.04976, i64 16
  %.049 = load ptr, ptr %31, align 8, !tbaa !26
  %cond = icmp eq ptr %.049, null
  br i1 %cond, label %._crit_edge, label %.lr.ph, !llvm.loop !29

._crit_edge:                                      ; preds = %30, %.critedge67
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  br label %34

.critedge:                                        ; preds = %.lr.ph
  %33 = getelementptr inbounds i8, ptr %.04976, i64 8
  br label %34

34:                                               ; preds = %.critedge, %._crit_edge
  %.in = phi ptr [ %32, %._crit_edge ], [ %33, %.critedge ]
  %35 = load ptr, ptr %.in, align 8, !tbaa !26
  %36 = getelementptr inbounds i8, ptr %1, i64 32
  store volatile ptr %35, ptr %36, align 8, !tbaa !31
  tail call void @_ZN8Row_mvcc14insert_historyEmP5row_t(ptr noundef nonnull align 8 dereferenceable(104) %0, i64 noundef %5, ptr noundef null)
  %37 = getelementptr inbounds i8, ptr %0, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = tail call noundef ptr @_ZN5row_t14get_table_nameEv(ptr noundef nonnull align 8 dereferenceable(64) %38)
  %40 = tail call noundef ptr @_ZN5row_t14get_table_nameEv(ptr noundef nonnull align 8 dereferenceable(64) %35)
  %41 = tail call noundef ptr @strstr(ptr noundef nonnull dereferenceable(1) %39, ptr noundef nonnull dereferenceable(1) %40) #8
  %.not62 = icmp eq ptr %41, null
  br i1 %.not62, label %42, label %60

42:                                               ; preds = %34
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 273, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

43:                                               ; preds = %15
  %44 = tail call noundef zeroext i1 @_ZN8Row_mvcc8conflictE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 2, i64 noundef %5)
  br i1 %44, label %95, label %45

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %0, i64 96
  %47 = load i64, ptr %46, align 8, !tbaa !32
  %48 = load i64, ptr @g_max_pre_req, align 8, !tbaa !17
  %49 = icmp ult i64 %47, %48
  br i1 %49, label %50, label %95

50:                                               ; preds = %45
  tail call void @_ZN8Row_mvcc10buffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 2, ptr noundef nonnull %1)
  br label %60

51:                                               ; preds = %15
  tail call void @_ZN8Row_mvcc14insert_historyEmP5row_t(ptr noundef nonnull align 8 dereferenceable(104) %0, i64 noundef %5, ptr noundef %3)
  %52 = tail call noundef ptr @_ZN8Row_mvcc12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 2, ptr noundef nonnull %1)
  %.not60 = icmp eq ptr %52, null
  br i1 %.not60, label %53, label %54

53:                                               ; preds = %51
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 291, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

54:                                               ; preds = %51
  tail call void @_ZN8Row_mvcc16return_req_entryEP10MVReqEntry(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %52)
  tail call void @_ZN8Row_mvcc13update_bufferEP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %1)
  br label %60

55:                                               ; preds = %15
  %56 = tail call noundef ptr @_ZN8Row_mvcc12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 2, ptr noundef nonnull %1)
  %.not = icmp eq ptr %56, null
  br i1 %.not, label %57, label %58

57:                                               ; preds = %55
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 297, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

58:                                               ; preds = %55
  tail call void @_ZN8Row_mvcc16return_req_entryEP10MVReqEntry(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %56)
  tail call void @_ZN8Row_mvcc13update_bufferEP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %1)
  br label %60

59:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 301, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

60:                                               ; preds = %50, %54, %58, %34
  %61 = getelementptr inbounds i8, ptr %0, i64 72
  %62 = load i64, ptr %61, align 8, !tbaa !33
  %63 = load i64, ptr @g_his_recycle_len, align 8, !tbaa !17
  %64 = icmp ugt i64 %62, %63
  %65 = getelementptr inbounds i8, ptr %0, i64 80
  %66 = load i64, ptr %65, align 8
  %67 = icmp ugt i64 %66, %63
  %or.cond = select i1 %64, i1 true, i1 %67
  br i1 %or.cond, label %68, label %95

68:                                               ; preds = %60
  %69 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %1)
  %70 = tail call noundef i64 @_ZN7Manager10get_min_tsEm(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, i64 noundef %69)
  %71 = getelementptr inbounds i8, ptr %0, i64 56
  %72 = load ptr, ptr %71, align 8, !tbaa !34
  %.not63 = icmp eq ptr %72, null
  br i1 %.not63, label %78, label %73

73:                                               ; preds = %68
  %74 = load i64, ptr %72, align 8, !tbaa !27
  %75 = icmp ult i64 %74, %70
  br i1 %75, label %76, label %78

76:                                               ; preds = %73
  %77 = tail call noundef ptr @_ZN8Row_mvcc13clear_historyE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 0, i64 noundef %70)
  br label %78

78:                                               ; preds = %76, %73, %68
  %79 = load i64, ptr %61, align 8, !tbaa !33
  %80 = icmp ugt i64 %79, 1
  br i1 %80, label %81, label %95

81:                                               ; preds = %78
  %82 = getelementptr inbounds i8, ptr %0, i64 64
  %83 = load ptr, ptr %82, align 8, !tbaa !35
  %84 = getelementptr inbounds i8, ptr %83, i64 24
  %85 = load ptr, ptr %84, align 8, !tbaa !36
  %86 = load i64, ptr %85, align 8, !tbaa !27
  %87 = icmp ult i64 %86, %70
  br i1 %87, label %88, label %95

88:                                               ; preds = %81
  %89 = tail call noundef ptr @_ZN8Row_mvcc13clear_historyE6TsTypem(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 1, i64 noundef %70)
  %.not64 = icmp eq ptr %89, null
  br i1 %.not64, label %95, label %90

90:                                               ; preds = %88
  %91 = getelementptr inbounds i8, ptr %0, i64 16
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %.not65 = icmp eq ptr %92, %89
  br i1 %.not65, label %93, label %94

93:                                               ; preds = %90
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 317, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Row_mvcc6accessEP10TxnManager6TsTypeP5row_t) #9
  unreachable

94:                                               ; preds = %90
  tail call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %92, ptr noundef nonnull %89)
  br label %95

95:                                               ; preds = %25, %23, %43, %45, %78, %81, %94, %88, %60
  %.171 = phi i32 [ 0, %78 ], [ 0, %81 ], [ 0, %94 ], [ 0, %88 ], [ 0, %60 ], [ 3, %23 ], [ 2, %25 ], [ 2, %43 ], [ 2, %45 ]
  %96 = tail call noundef i64 @_Z13get_sys_clockv()
  %97 = sub i64 %96, %6
  %98 = uitofp i64 %97 to double
  %99 = getelementptr inbounds i8, ptr %1, i64 344
  %100 = load double, ptr %99, align 8, !tbaa !37
  %101 = fadd double %100, %98
  store double %101, ptr %99, align 8, !tbaa !37
  %102 = getelementptr inbounds i8, ptr %1, i64 384
  %103 = load double, ptr %102, align 8, !tbaa !38
  %104 = fadd double %103, %98
  store double %104, ptr %102, align 8, !tbaa !38
  %105 = load i8, ptr @g_central_man, align 1, !tbaa !5, !range !9, !noundef !10
  %106 = trunc nuw i8 %105 to i1
  br i1 %106, label %107, label %110

107:                                              ; preds = %95
  %108 = getelementptr inbounds i8, ptr %0, i64 16
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  tail call void @_ZN7Manager11release_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, ptr noundef %109)
  br label %113

110:                                              ; preds = %95
  %111 = load ptr, ptr %0, align 8, !tbaa !15
  %112 = tail call i32 @pthread_mutex_unlock(ptr noundef %111) #7
  br label %113

113:                                              ; preds = %110, %107
  ret i32 %.171
}

declare void @_ZN7Manager8lock_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320), ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare noundef ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #6

declare noundef ptr @_ZN5row_t14get_table_nameEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Row_mvcc13update_bufferEP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) local_unnamed_addr #0 align 2

declare noundef i64 @_ZN7Manager10get_min_tsEm(ptr noundef nonnull align 8 dereferenceable(1320), i64 noundef) local_unnamed_addr #2

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

declare void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef) local_unnamed_addr #2

declare void @_ZN7Manager11release_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320), ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) local_unnamed_addr #4

attributes #0 = { 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 #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 = { "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 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 "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 = { nofree 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !13, i64 16}
!12 = !{!"_ZTS8Row_mvcc", !13, i64 0, !6, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !13, i64 0}
!16 = !{!12, !14, i64 88}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !6, i64 44}
!19 = !{!"_ZTS10TxnManager", !13, i64 8, !13, i64 16, !6, i64 24, !13, i64 32, !20, i64 40, !6, i64 44, !20, i64 48, !20, i64 52, !6, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !14, i64 120, !6, i64 128, !6, i64 129, !13, i64 136, !13, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !21, i64 176, !20, i64 432, !20, i64 436, !20, i64 440, !6, i64 444, !23, i64 448, !24, i64 456, !20, i64 480, !13, i64 488, !13, i64 496, !25, i64 504, !7, i64 512}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTS8TxnStats", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !22, i64 40, !22, i64 48, !22, i64 56, !22, i64 64, !22, i64 72, !22, i64 80, !22, i64 88, !22, i64 96, !22, i64 104, !22, i64 112, !22, i64 120, !22, i64 128, !22, i64 136, !22, i64 144, !22, i64 152, !22, i64 160, !22, i64 168, !14, i64 176, !14, i64 184, !22, i64 192, !22, i64 200, !22, i64 208, !22, i64 216, !22, i64 224, !22, i64 232, !22, i64 240, !22, i64 248}
!22 = !{!"double", !7, i64 0}
!23 = !{!"_ZTS12CALVIN_PHASE", !7, i64 0}
!24 = !{!"_ZTS5ArrayIP5row_tE", !13, i64 0, !14, i64 8, !14, i64 16}
!25 = !{!"_ZTS8access_t", !7, i64 0}
!26 = !{!13, !13, i64 0}
!27 = !{!28, !14, i64 0}
!28 = !{!"_ZTS10MVHisEntry", !14, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!19, !13, i64 32}
!32 = !{!12, !14, i64 96}
!33 = !{!12, !14, i64 72}
!34 = !{!12, !13, i64 56}
!35 = !{!12, !13, i64 64}
!36 = !{!28, !13, i64 24}
!37 = !{!19, !22, i64 344}
!38 = !{!19, !22, i64 384}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass