; LLVM IR from mitdbg/deneva :: concurrency_control/row_ts.ll (ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_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.mem_alloc = type { i8 }
%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_ts = type { ptr, i8, ptr, i64, i64, i64, i64, i64, ptr, ptr, ptr, 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] }

@mem_allocator = external global %class.mem_alloc, align 1
@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = 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
@__PRETTY_FUNCTION__._ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t = external hidden unnamed_addr constant [49 x i8], align 1

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

declare void @_ZN5row_t8free_rowEv(ptr noundef nonnull align 8 dereferenceable(64)) #1

declare void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, i64 noundef) #1

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

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

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

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

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

declare noundef i64 @_Z13get_sys_clockv() #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %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 ptr, align 8
  %13 = alloca ptr, align 8
  %14 = 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
  %15 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %16 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %16, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call noundef i64 @_ZN10TxnManager13get_timestampEv(ptr noundef nonnull align 8 dereferenceable(544) %17)
  store i64 %18, ptr %11, align 8, !tbaa !11
  %19 = load i8, ptr @g_central_man, align 1, !tbaa !13, !range !15, !noundef !16
  %20 = trunc i8 %19 to i1
  br i1 %20, label %21, label %24

21:                                               ; preds = %4
  %22 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 2
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  call void @_ZN7Manager8lock_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, ptr noundef %23)
  br label %28

24:                                               ; preds = %4
  %25 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !19
  %27 = call i32 @pthread_mutex_lock(ptr noundef %26) #5
  br label %28

28:                                               ; preds = %24, %21
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %62

31:                                               ; preds = %28
  %32 = load i64, ptr %11, align 8, !tbaa !11
  %33 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 3
  %34 = load i64, ptr %33, align 8, !tbaa !20
  %35 = icmp ult i64 %32, %34
  br i1 %35, label %36, label %37

36:                                               ; preds = %31
  store i32 2, ptr %9, align 4, !tbaa !21
  br label %61

37:                                               ; preds = %31
  %38 = load i64, ptr %11, align 8, !tbaa !11
  %39 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 7
  %40 = load i64, ptr %39, align 8, !tbaa !23
  %41 = icmp ugt i64 %38, %40
  br i1 %41, label %42, label %46

42:                                               ; preds = %37
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 0, ptr noundef %43, ptr noundef null)
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.TxnManager, ptr %44, i32 0, i32 6
  store volatile i8 0, ptr %45, align 4, !tbaa !24
  store i32 3, ptr %9, align 4, !tbaa !21
  br label %60

46:                                               ; preds = %37
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %class.TxnManager, ptr %47, i32 0, i32 4
  %49 = load volatile ptr, ptr %48, align 8, !tbaa !32
  %50 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %49, ptr noundef %51)
  %52 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 4
  %53 = load i64, ptr %52, align 8, !tbaa !33
  %54 = load i64, ptr %11, align 8, !tbaa !11
  %55 = icmp ult i64 %53, %54
  br i1 %55, label %56, label %59

56:                                               ; preds = %46
  %57 = load i64, ptr %11, align 8, !tbaa !11
  %58 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 4
  store i64 %57, ptr %58, align 8, !tbaa !33
  br label %59

59:                                               ; preds = %56, %46
  store i32 0, ptr %9, align 4, !tbaa !21
  br label %60

60:                                               ; preds = %59, %42
  br label %61

61:                                               ; preds = %60, %36
  br label %148

62:                                               ; preds = %28
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = icmp eq i32 %63, 2
  br i1 %64, label %65, label %81

65:                                               ; preds = %62
  %66 = load i64, ptr %11, align 8, !tbaa !11
  %67 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 4
  %68 = load i64, ptr %67, align 8, !tbaa !33
  %69 = icmp ult i64 %66, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %65
  store i32 2, ptr %9, align 4, !tbaa !21
  br label %80

71:                                               ; preds = %65
  %72 = load i64, ptr %11, align 8, !tbaa !11
  %73 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 3
  %74 = load i64, ptr %73, align 8, !tbaa !20
  %75 = icmp ult i64 %72, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %71
  store i32 2, ptr %9, align 4, !tbaa !21
  br label %79

77:                                               ; preds = %71
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 2, ptr noundef %78, ptr noundef null)
  store i32 0, ptr %9, align 4, !tbaa !21
  br label %79

79:                                               ; preds = %77, %76
  br label %80

80:                                               ; preds = %79, %70
  br label %147

81:                                               ; preds = %62
  %82 = load i32, ptr %7, align 4, !tbaa !9
  %83 = icmp eq i32 %82, 1
  br i1 %83, label %84, label %129

84:                                               ; preds = %81
  store i32 0, ptr %9, align 4, !tbaa !21
  %85 = load i64, ptr %11, align 8, !tbaa !11
  %86 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 7
  %87 = load i64, ptr %86, align 8, !tbaa !23
  %88 = icmp ugt i64 %85, %87
  br i1 %88, label %89, label %92

89:                                               ; preds = %84
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 1, ptr noundef %90, ptr noundef %91)
  br label %149

92:                                               ; preds = %84
  %93 = load i64, ptr %11, align 8, !tbaa !11
  %94 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 6
  %95 = load i64, ptr %94, align 8, !tbaa !34
  %96 = icmp ugt i64 %93, %95
  br i1 %96, label %97, label %103

97:                                               ; preds = %92
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %class.TxnManager, ptr %98, i32 0, i32 4
  %100 = load volatile ptr, ptr %99, align 8, !tbaa !32
  store ptr %100, ptr %8, align 8, !tbaa !5
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 1, ptr noundef %101, ptr noundef %102)
  br label %149

103:                                              ; preds = %92
  %104 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 2
  %105 = load ptr, ptr %104, align 8, !tbaa !17
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %105, ptr noundef %106)
  %107 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 3
  %108 = load i64, ptr %107, align 8, !tbaa !20
  %109 = load i64, ptr %11, align 8, !tbaa !11
  %110 = icmp ult i64 %108, %109
  br i1 %110, label %111, label %114

111:                                              ; preds = %103
  %112 = load i64, ptr %11, align 8, !tbaa !11
  %113 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 3
  store i64 %112, ptr %113, align 8, !tbaa !20
  br label %114

114:                                              ; preds = %111, %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 2, ptr noundef %115)
  store ptr %116, ptr %12, align 8, !tbaa !5
  %117 = load ptr, ptr %12, align 8, !tbaa !5
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %120

119:                                              ; preds = %114
  br label %122

120:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 242, ptr noundef @__PRETTY_FUNCTION__._ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t) #6
  unreachable

121:                                              ; No predecessors!
  br label %122

122:                                              ; preds = %121, %119
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %123)
  call void @_ZN6Row_ts13update_bufferEm(ptr noundef nonnull align 8 dereferenceable(96) %15, i64 noundef %124)
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN6Row_ts16return_req_entryEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %15, ptr noundef %125)
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN5row_t8free_rowEv(ptr noundef nonnull align 8 dereferenceable(64) %126)
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, ptr noundef %127, i64 noundef 64)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %128

128:                                              ; preds = %122
  br label %146

129:                                              ; preds = %81
  %130 = load i32, ptr %7, align 4, !tbaa !9
  %131 = icmp eq i32 %130, 3
  br i1 %131, label %132, label %144

132:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 2, ptr noundef %133)
  store ptr %134, ptr %13, align 8, !tbaa !5
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %138

137:                                              ; preds = %132
  br label %140

138:                                              ; preds = %132
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 251, ptr noundef @__PRETTY_FUNCTION__._ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t) #6
  unreachable

139:                                              ; No predecessors!
  br label %140

140:                                              ; preds = %139, %137
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %141)
  call void @_ZN6Row_ts13update_bufferEm(ptr noundef nonnull align 8 dereferenceable(96) %15, i64 noundef %142)
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN6Row_ts16return_req_entryEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %15, ptr noundef %143)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %145

144:                                              ; preds = %129
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 255, ptr noundef @__PRETTY_FUNCTION__._ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t) #6
  unreachable

145:                                              ; preds = %140
  br label %146

146:                                              ; preds = %145, %128
  br label %147

147:                                              ; preds = %146, %80
  br label %148

148:                                              ; preds = %147, %61
  br label %149

149:                                              ; preds = %148, %97, %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %150 = call noundef i64 @_Z13get_sys_clockv()
  %151 = load i64, ptr %10, align 8, !tbaa !11
  %152 = sub i64 %150, %151
  store i64 %152, ptr %14, align 8, !tbaa !11
  %153 = load i64, ptr %14, align 8, !tbaa !11
  %154 = uitofp i64 %153 to double
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %class.TxnManager, ptr %155, i32 0, i32 25
  %157 = getelementptr inbounds %class.TxnStats, ptr %156, i32 0, i32 21
  %158 = load double, ptr %157, align 8, !tbaa !35
  %159 = fadd double %158, %154
  store double %159, ptr %157, align 8, !tbaa !35
  %160 = load i64, ptr %14, align 8, !tbaa !11
  %161 = uitofp i64 %160 to double
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %class.TxnManager, ptr %162, i32 0, i32 25
  %164 = getelementptr inbounds %class.TxnStats, ptr %163, i32 0, i32 26
  %165 = load double, ptr %164, align 8, !tbaa !36
  %166 = fadd double %165, %161
  store double %166, ptr %164, align 8, !tbaa !36
  %167 = load i8, ptr @g_central_man, align 1, !tbaa !13, !range !15, !noundef !16
  %168 = trunc i8 %167 to i1
  br i1 %168, label %169, label %172

169:                                              ; preds = %149
  %170 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 2
  %171 = load ptr, ptr %170, align 8, !tbaa !17
  call void @_ZN7Manager11release_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, ptr noundef %171)
  br label %176

172:                                              ; preds = %149
  %173 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !19
  %175 = call i32 @pthread_mutex_unlock(ptr noundef %174) #5
  br label %176

176:                                              ; preds = %172, %169
  %177 = load i32, ptr %9, align 4, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret i32 %177
}

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

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

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

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

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

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

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { nounwind }
attributes #6 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTS6TsType", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !6, i64 16}
!18 = !{!"_ZTS6Row_ts", !6, i64 0, !14, i64 8, !6, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88}
!19 = !{!18, !6, i64 0}
!20 = !{!18, !12, i64 24}
!21 = !{!22, !22, i64 0}
!22 = !{!"_ZTS2RC", !7, i64 0}
!23 = !{!18, !12, i64 56}
!24 = !{!25, !14, i64 44}
!25 = !{!"_ZTS10TxnManager", !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 32, !26, i64 40, !14, i64 44, !26, i64 48, !26, i64 52, !14, 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, !14, i64 128, !14, i64 129, !6, i64 136, !6, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !27, i64 176, !26, i64 432, !26, i64 436, !26, i64 440, !14, i64 444, !29, i64 448, !30, i64 456, !26, i64 480, !6, i64 488, !6, i64 496, !31, i64 504, !7, i64 512}
!26 = !{!"int", !7, i64 0}
!27 = !{!"_ZTS8TxnStats", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !28, i64 40, !28, i64 48, !28, i64 56, !28, i64 64, !28, i64 72, !28, i64 80, !28, i64 88, !28, i64 96, !28, i64 104, !28, i64 112, !28, i64 120, !28, i64 128, !28, i64 136, !28, i64 144, !28, i64 152, !28, i64 160, !28, i64 168, !12, i64 176, !12, i64 184, !28, i64 192, !28, i64 200, !28, i64 208, !28, i64 216, !28, i64 224, !28, i64 232, !28, i64 240, !28, i64 248}
!28 = !{!"double", !7, i64 0}
!29 = !{!"_ZTS12CALVIN_PHASE", !7, i64 0}
!30 = !{!"_ZTS5ArrayIP5row_tE", !6, i64 0, !12, i64 8, !12, i64 16}
!31 = !{!"_ZTS8access_t", !7, i64 0}
!32 = !{!25, !6, i64 32}
!33 = !{!18, !12, i64 32}
!34 = !{!18, !12, i64 48}
!35 = !{!25, !28, i64 344}
!36 = !{!25, !28, 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.mem_alloc = type { i8 }
%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 }

@mem_allocator = external global %class.mem_alloc, align 1
@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = 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
@__PRETTY_FUNCTION__._ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t = external hidden unnamed_addr constant [49 x i8], align 1

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

declare void @_ZN5row_t8free_rowEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1

declare void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, ptr noundef, ptr 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 #2

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

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 align 2 {
  %5 = tail call noundef i64 @_Z13get_sys_clockv()
  %6 = tail call noundef i64 @_ZN10TxnManager13get_timestampEv(ptr noundef nonnull align 8 dereferenceable(544) %1)
  %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) #4
  br label %15

15:                                               ; preds = %12, %9
  switch i32 %2, label %72 [
    i32 0, label %16
    i32 2, label %35
    i32 1, label %43
    i32 3, label %67
  ]

16:                                               ; preds = %15
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = load i64, ptr %17, align 8, !tbaa !16
  %19 = icmp ult i64 %6, %18
  br i1 %19, label %73, label %20

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %0, i64 56
  %22 = load i64, ptr %21, align 8, !tbaa !17
  %23 = icmp ugt i64 %6, %22
  br i1 %23, label %24, label %26

24:                                               ; preds = %20
  tail call void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 0, ptr noundef nonnull %1, ptr noundef null)
  %25 = getelementptr inbounds i8, ptr %1, i64 44
  store volatile i8 0, ptr %25, align 4, !tbaa !18
  br label %73

26:                                               ; preds = %20
  %27 = getelementptr inbounds i8, ptr %1, i64 32
  %28 = load volatile ptr, ptr %27, align 8, !tbaa !26
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  tail call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %28, ptr noundef %30)
  %31 = getelementptr inbounds i8, ptr %0, i64 32
  %32 = load i64, ptr %31, align 8, !tbaa !27
  %33 = icmp ult i64 %32, %6
  br i1 %33, label %34, label %73

34:                                               ; preds = %26
  store i64 %6, ptr %31, align 8, !tbaa !27
  br label %73

35:                                               ; preds = %15
  %36 = getelementptr inbounds i8, ptr %0, i64 32
  %37 = load i64, ptr %36, align 8, !tbaa !27
  %38 = icmp ult i64 %6, %37
  %39 = getelementptr inbounds i8, ptr %0, i64 24
  %40 = load i64, ptr %39, align 8
  %41 = icmp ult i64 %6, %40
  %or.cond = select i1 %38, i1 true, i1 %41
  br i1 %or.cond, label %73, label %42

42:                                               ; preds = %35
  tail call void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 2, ptr noundef nonnull %1, ptr noundef null)
  br label %73

43:                                               ; preds = %15
  %44 = getelementptr inbounds i8, ptr %0, i64 56
  %45 = load i64, ptr %44, align 8, !tbaa !17
  %46 = icmp ugt i64 %6, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  tail call void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 1, ptr noundef nonnull %1, ptr noundef %3)
  br label %73

48:                                               ; preds = %43
  %49 = getelementptr inbounds i8, ptr %0, i64 48
  %50 = load i64, ptr %49, align 8, !tbaa !28
  %51 = icmp ugt i64 %6, %50
  br i1 %51, label %52, label %55

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %1, i64 32
  %54 = load volatile ptr, ptr %53, align 8, !tbaa !26
  tail call void @_ZN6Row_ts10buffer_reqE6TsTypeP10TxnManagerP5row_t(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 1, ptr noundef nonnull %1, ptr noundef %54)
  br label %73

55:                                               ; preds = %48
  %56 = getelementptr inbounds i8, ptr %0, i64 16
  %57 = load ptr, ptr %56, align 8, !tbaa !11
  tail call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %57, ptr noundef %3)
  %58 = getelementptr inbounds i8, ptr %0, i64 24
  %59 = load i64, ptr %58, align 8, !tbaa !16
  %60 = icmp ult i64 %59, %6
  br i1 %60, label %61, label %62

61:                                               ; preds = %55
  store i64 %6, ptr %58, align 8, !tbaa !16
  br label %62

62:                                               ; preds = %61, %55
  %63 = tail call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 2, ptr noundef nonnull %1)
  %.not45 = icmp eq ptr %63, null
  br i1 %.not45, label %64, label %65

64:                                               ; preds = %62
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 242, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t) #5
  unreachable

65:                                               ; preds = %62
  %66 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %1)
  tail call void @_ZN6Row_ts13update_bufferEm(ptr noundef nonnull align 8 dereferenceable(96) %0, i64 noundef %66)
  tail call void @_ZN6Row_ts16return_req_entryEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %63)
  tail call void @_ZN5row_t8free_rowEv(ptr noundef nonnull align 8 dereferenceable(64) %3)
  tail call void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, ptr noundef nonnull %3, i64 noundef 64)
  br label %73

67:                                               ; preds = %15
  %68 = tail call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 2, ptr noundef nonnull %1)
  %.not = icmp eq ptr %68, null
  br i1 %.not, label %69, label %70

69:                                               ; preds = %67
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 251, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t) #5
  unreachable

70:                                               ; preds = %67
  %71 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %1)
  tail call void @_ZN6Row_ts13update_bufferEm(ptr noundef nonnull align 8 dereferenceable(96) %0, i64 noundef %71)
  tail call void @_ZN6Row_ts16return_req_entryEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %68)
  br label %73

72:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 255, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6Row_ts6accessEP10TxnManager6TsTypeP5row_t) #5
  unreachable

73:                                               ; preds = %35, %26, %34, %16, %24, %65, %70, %42, %52, %47
  %.0 = phi i32 [ 3, %24 ], [ 0, %42 ], [ 0, %47 ], [ 0, %52 ], [ 0, %65 ], [ undef, %70 ], [ 2, %16 ], [ 0, %34 ], [ 0, %26 ], [ 2, %35 ]
  %74 = tail call noundef i64 @_Z13get_sys_clockv()
  %75 = sub i64 %74, %5
  %76 = uitofp i64 %75 to double
  %77 = getelementptr inbounds i8, ptr %1, i64 344
  %78 = load double, ptr %77, align 8, !tbaa !29
  %79 = fadd double %78, %76
  store double %79, ptr %77, align 8, !tbaa !29
  %80 = getelementptr inbounds i8, ptr %1, i64 384
  %81 = load double, ptr %80, align 8, !tbaa !30
  %82 = fadd double %81, %76
  store double %82, ptr %80, align 8, !tbaa !30
  %83 = load i8, ptr @g_central_man, align 1, !tbaa !5, !range !9, !noundef !10
  %84 = trunc nuw i8 %83 to i1
  br i1 %84, label %85, label %88

85:                                               ; preds = %73
  %86 = getelementptr inbounds i8, ptr %0, i64 16
  %87 = load ptr, ptr %86, align 8, !tbaa !11
  tail call void @_ZN7Manager11release_rowEP5row_t(ptr noundef nonnull align 8 dereferenceable(1320) @glob_manager, ptr noundef %87)
  br label %91

88:                                               ; preds = %73
  %89 = load ptr, ptr %0, align 8, !tbaa !15
  %90 = tail call i32 @pthread_mutex_unlock(ptr noundef %89) #4
  br label %91

91:                                               ; preds = %88, %85
  ret i32 %.0
}

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

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

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

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

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

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

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

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 = { "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 = { 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 = { 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"_ZTS6Row_ts", !13, i64 0, !6, i64 8, !13, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !14, i64 88}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !13, i64 0}
!16 = !{!12, !14, i64 24}
!17 = !{!12, !14, i64 56}
!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 = !{!19, !13, i64 32}
!27 = !{!12, !14, i64 32}
!28 = !{!12, !14, i64 48}
!29 = !{!19, !22, i64 344}
!30 = !{!19, !22, i64 384}


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