; LLVM IR from mitdbg/deneva :: concurrency_control/row_mvcc.ll (ZN8Row_mvcc13update_bufferEP10TxnManager)

; 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.TxnTable = type { i64, ptr }
%class.Row_mvcc = type { ptr, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64 }
%struct.MVHisEntry = type { i64, ptr, ptr, ptr }
%struct.MVReqEntry = type { ptr, i64, i64, 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 }
%union.sem_t = type { i64, [24 x i8] }

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN8Row_mvcc13update_bufferEP10TxnManager = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [40 x i8], align 1
@txn_table = external global %class.TxnTable, 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Row_mvcc13update_bufferEP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %12 = call noundef ptr @_ZN8Row_mvcc12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %11, i32 noundef 0, ptr noundef null)
  store ptr %12, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %13, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %80, %2
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %119

17:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %18 = getelementptr inbounds %class.Row_mvcc, ptr %11, i32 0, i32 6
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  store ptr %19, ptr %8, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %33, %17
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %31

23:                                               ; preds = %20
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.MVHisEntry, ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.MVReqEntry, ptr %27, i32 0, i32 1
  %29 = load i64, ptr %28, align 8, !tbaa !15
  %30 = icmp ugt i64 %26, %29
  br label %31

31:                                               ; preds = %23, %20
  %32 = phi i1 [ false, %20 ], [ %30, %23 ]
  br i1 %32, label %33, label %37

33:                                               ; preds = %31
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.MVHisEntry, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !17
  store ptr %36, ptr %8, align 8, !tbaa !5
  br label %20, !llvm.loop !18

37:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %43

40:                                               ; preds = %37
  %41 = getelementptr inbounds %class.Row_mvcc, ptr %11, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !20
  br label %47

43:                                               ; preds = %37
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.MVHisEntry, ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  br label %47

47:                                               ; preds = %43, %40
  %48 = phi ptr [ %42, %40 ], [ %46, %43 ]
  store ptr %48, ptr %9, align 8, !tbaa !5
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.MVReqEntry, ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !22
  %53 = getelementptr inbounds %class.TxnManager, ptr %52, i32 0, i32 4
  store volatile ptr %49, ptr %53, align 8, !tbaa !23
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.MVReqEntry, ptr %54, i32 0, i32 1
  %56 = load i64, ptr %55, align 8, !tbaa !15
  call void @_ZN8Row_mvcc14insert_historyEmP5row_t(ptr noundef nonnull align 8 dereferenceable(104) %11, i64 noundef %56, ptr noundef null)
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = call noundef ptr @_ZN5row_t8get_dataEv(ptr noundef nonnull align 8 dereferenceable(64) %57)
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %61

60:                                               ; preds = %47
  br label %63

61:                                               ; preds = %47
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 350, ptr noundef @__PRETTY_FUNCTION__._ZN8Row_mvcc13update_bufferEP10TxnManager) #6
  unreachable

62:                                               ; No predecessors!
  br label %63

63:                                               ; preds = %62, %60
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = call noundef ptr @_ZN5row_t9get_tableEv(ptr noundef nonnull align 8 dereferenceable(64) %64)
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  br label %70

68:                                               ; preds = %63
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 351, ptr noundef @__PRETTY_FUNCTION__._ZN8Row_mvcc13update_bufferEP10TxnManager) #6
  unreachable

69:                                               ; No predecessors!
  br label %70

70:                                               ; preds = %69, %67
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = call noundef ptr @_ZN5row_t10get_schemaEv(ptr noundef nonnull align 8 dereferenceable(64) %71)
  %73 = getelementptr inbounds %class.Row_mvcc, ptr %11, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = call noundef ptr @_ZN5row_t10get_schemaEv(ptr noundef nonnull align 8 dereferenceable(64) %74)
  %76 = icmp eq ptr %72, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %70
  br label %80

78:                                               ; preds = %70
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 352, ptr noundef @__PRETTY_FUNCTION__._ZN8Row_mvcc13update_bufferEP10TxnManager) #6
  unreachable

79:                                               ; No predecessors!
  br label %80

80:                                               ; preds = %79, %77
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.MVReqEntry, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !22
  %84 = getelementptr inbounds %class.TxnManager, ptr %83, i32 0, i32 6
  store volatile i8 1, ptr %84, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %85 = call noundef i64 @_Z13get_sys_clockv()
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.MVReqEntry, ptr %86, i32 0, i32 2
  %88 = load i64, ptr %87, align 8, !tbaa !32
  %89 = sub i64 %85, %88
  store i64 %89, ptr %10, align 8, !tbaa !33
  %90 = load i64, ptr %10, align 8, !tbaa !33
  %91 = uitofp i64 %90 to double
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.MVReqEntry, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !22
  %95 = getelementptr inbounds %class.TxnManager, ptr %94, i32 0, i32 25
  %96 = getelementptr inbounds %class.TxnStats, ptr %95, i32 0, i32 19
  %97 = load double, ptr %96, align 8, !tbaa !34
  %98 = fadd double %97, %91
  store double %98, ptr %96, align 8, !tbaa !34
  %99 = load i64, ptr %10, align 8, !tbaa !33
  %100 = uitofp i64 %99 to double
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.MVReqEntry, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !22
  %104 = getelementptr inbounds %class.TxnManager, ptr %103, i32 0, i32 25
  %105 = getelementptr inbounds %class.TxnStats, ptr %104, i32 0, i32 25
  %106 = load double, ptr %105, align 8, !tbaa !35
  %107 = fadd double %106, %100
  store double %107, ptr %105, align 8, !tbaa !35
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %108)
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MVReqEntry, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !22
  %113 = call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %112)
  call void @_ZN8TxnTable11restart_txnEmmm(ptr noundef nonnull align 8 dereferenceable(16) @txn_table, i64 noundef %109, i64 noundef %113, i64 noundef 0)
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %114, ptr %7, align 8, !tbaa !5
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.MVReqEntry, ptr %115, i32 0, i32 3
  %117 = load ptr, ptr %116, align 8, !tbaa !36
  store ptr %117, ptr %6, align 8, !tbaa !5
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN8Row_mvcc16return_req_entryEP10MVReqEntry(ptr noundef nonnull align 8 dereferenceable(104) %11, ptr noundef %118)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %14, !llvm.loop !37

119:                                              ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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

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

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

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

declare void @_ZN8TxnTable11restart_txnEmmm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef, i64 noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #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 }
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, !6, i64 48}
!10 = !{!"_ZTS8Row_mvcc", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTS10MVHisEntry", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!16, !12, i64 8}
!16 = !{!"_ZTS10MVReqEntry", !6, i64 0, !12, i64 8, !12, i64 16, !6, i64 24}
!17 = !{!14, !6, i64 16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!10, !6, i64 16}
!21 = !{!14, !6, i64 8}
!22 = !{!16, !6, i64 0}
!23 = !{!24, !6, i64 32}
!24 = !{!"_ZTS10TxnManager", !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !25, i64 40, !11, i64 44, !25, i64 48, !25, i64 52, !11, 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, !11, i64 128, !11, i64 129, !6, i64 136, !6, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !26, i64 176, !25, i64 432, !25, i64 436, !25, i64 440, !11, 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", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, 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, !12, i64 176, !12, 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, !12, i64 8, !12, i64 16}
!30 = !{!"_ZTS8access_t", !7, i64 0}
!31 = !{!24, !11, i64 44}
!32 = !{!16, !12, i64 16}
!33 = !{!12, !12, i64 0}
!34 = !{!24, !27, i64 328}
!35 = !{!24, !27, i64 376}
!36 = !{!16, !6, i64 24}
!37 = distinct !{!37, !19}


; 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.TxnTable = type { i64, ptr }

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN8Row_mvcc13update_bufferEP10TxnManager = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [40 x i8], align 1
@txn_table = external global %class.TxnTable, align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Row_mvcc13update_bufferEP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = tail call noundef ptr @_ZN8Row_mvcc12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef 0, ptr noundef null)
  %.not33 = icmp eq ptr %3, null
  br i1 %.not33, label %._crit_edge37, label %.lr.ph36

.lr.ph36:                                         ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  br label %6

6:                                                ; preds = %.lr.ph36, %31
  %.034 = phi ptr [ %3, %.lr.ph36 ], [ %50, %31 ]
  %.02530 = load ptr, ptr %4, align 8, !tbaa !5
  %cond31 = icmp eq ptr %.02530, null
  br i1 %cond31, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6
  %7 = getelementptr inbounds i8, ptr %.034, i64 8
  %8 = load i64, ptr %7, align 8, !tbaa !9
  br label %9

9:                                                ; preds = %.lr.ph, %12
  %.02532 = phi ptr [ %.02530, %.lr.ph ], [ %.025, %12 ]
  %10 = load i64, ptr %.02532, align 8, !tbaa !12
  %11 = icmp ugt i64 %10, %8
  br i1 %11, label %12, label %.critedge

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %.02532, i64 16
  %.025 = load ptr, ptr %13, align 8, !tbaa !5
  %cond = icmp eq ptr %.025, null
  br i1 %cond, label %._crit_edge, label %9, !llvm.loop !14

.critedge:                                        ; preds = %9
  %14 = getelementptr inbounds i8, ptr %.02532, i64 8
  br label %._crit_edge

._crit_edge:                                      ; preds = %12, %6, %.critedge
  %.in = phi ptr [ %14, %.critedge ], [ %5, %6 ], [ %5, %12 ]
  %15 = load ptr, ptr %.in, align 8, !tbaa !5
  %16 = load ptr, ptr %.034, align 8, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %16, i64 32
  store volatile ptr %15, ptr %17, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %.034, i64 8
  %19 = load i64, ptr %18, align 8, !tbaa !9
  tail call void @_ZN8Row_mvcc14insert_historyEmP5row_t(ptr noundef nonnull align 8 dereferenceable(104) %0, i64 noundef %19, ptr noundef null)
  %20 = tail call noundef ptr @_ZN5row_t8get_dataEv(ptr noundef nonnull align 8 dereferenceable(64) %15)
  %.not27 = icmp eq ptr %20, null
  br i1 %.not27, label %21, label %22

21:                                               ; preds = %._crit_edge
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 350, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Row_mvcc13update_bufferEP10TxnManager) #4
  unreachable

22:                                               ; preds = %._crit_edge
  %23 = tail call noundef ptr @_ZN5row_t9get_tableEv(ptr noundef nonnull align 8 dereferenceable(64) %15)
  %.not28 = icmp eq ptr %23, null
  br i1 %.not28, label %24, label %25

24:                                               ; preds = %22
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 351, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Row_mvcc13update_bufferEP10TxnManager) #4
  unreachable

25:                                               ; preds = %22
  %26 = tail call noundef ptr @_ZN5row_t10get_schemaEv(ptr noundef nonnull align 8 dereferenceable(64) %15)
  %27 = load ptr, ptr %5, align 8, !tbaa !26
  %28 = tail call noundef ptr @_ZN5row_t10get_schemaEv(ptr noundef nonnull align 8 dereferenceable(64) %27)
  %29 = icmp eq ptr %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 352, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Row_mvcc13update_bufferEP10TxnManager) #4
  unreachable

31:                                               ; preds = %25
  %32 = load ptr, ptr %.034, align 8, !tbaa !16
  %33 = getelementptr inbounds i8, ptr %32, i64 44
  store volatile i8 1, ptr %33, align 4, !tbaa !28
  %34 = tail call noundef i64 @_Z13get_sys_clockv()
  %35 = getelementptr inbounds i8, ptr %.034, i64 16
  %36 = load i64, ptr %35, align 8, !tbaa !29
  %37 = sub i64 %34, %36
  %38 = uitofp i64 %37 to double
  %39 = load ptr, ptr %.034, align 8, !tbaa !16
  %40 = getelementptr inbounds i8, ptr %39, i64 328
  %41 = load double, ptr %40, align 8, !tbaa !30
  %42 = fadd double %41, %38
  store double %42, ptr %40, align 8, !tbaa !30
  %43 = getelementptr inbounds i8, ptr %39, i64 376
  %44 = load double, ptr %43, align 8, !tbaa !31
  %45 = fadd double %44, %38
  store double %45, ptr %43, align 8, !tbaa !31
  %46 = tail call noundef i64 @_ZN10TxnManager10get_thd_idEv(ptr noundef nonnull align 8 dereferenceable(544) %1)
  %47 = load ptr, ptr %.034, align 8, !tbaa !16
  %48 = tail call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %47)
  tail call void @_ZN8TxnTable11restart_txnEmmm(ptr noundef nonnull align 8 dereferenceable(16) @txn_table, i64 noundef %46, i64 noundef %48, i64 noundef 0)
  %49 = getelementptr inbounds i8, ptr %.034, i64 24
  %50 = load ptr, ptr %49, align 8, !tbaa !32
  tail call void @_ZN8Row_mvcc16return_req_entryEP10MVReqEntry(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %.034)
  %.not = icmp eq ptr %50, null
  br i1 %.not, label %._crit_edge37, label %6, !llvm.loop !33

._crit_edge37:                                    ; preds = %31, %2
  ret void
}

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

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

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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, !11, i64 8}
!10 = !{!"_ZTS10MVReqEntry", !6, i64 0, !11, i64 8, !11, i64 16, !6, i64 24}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"_ZTS10MVHisEntry", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!10, !6, i64 0}
!17 = !{!18, !6, i64 32}
!18 = !{!"_ZTS10TxnManager", !6, i64 8, !6, i64 16, !19, i64 24, !6, i64 32, !20, i64 40, !19, i64 44, !20, i64 48, !20, i64 52, !19, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !11, i64 120, !19, i64 128, !19, i64 129, !6, i64 136, !6, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !21, i64 176, !20, i64 432, !20, i64 436, !20, i64 440, !19, i64 444, !23, i64 448, !24, i64 456, !20, i64 480, !6, i64 488, !6, i64 496, !25, i64 504, !7, i64 512}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTS8TxnStats", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, 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, !11, i64 176, !11, 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", !6, i64 0, !11, i64 8, !11, i64 16}
!25 = !{!"_ZTS8access_t", !7, i64 0}
!26 = !{!27, !6, i64 16}
!27 = !{!"_ZTS8Row_mvcc", !6, i64 0, !19, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96}
!28 = !{!18, !19, i64 44}
!29 = !{!10, !11, i64 16}
!30 = !{!18, !22, i64 328}
!31 = !{!18, !22, i64 376}
!32 = !{!10, !6, i64 24}
!33 = distinct !{!33, !15}


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