; LLVM IR from mitdbg/deneva :: concurrency_control/row_ts.ll (ZN6Row_ts13update_bufferEm)

; 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_ts = type { ptr, i8, ptr, i64, i64, i64, i64, i64, ptr, ptr, ptr, i64 }
%struct.TsReqEntry = type { ptr, ptr, 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 [78 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN6Row_ts13update_bufferEm = external hidden unnamed_addr constant [37 x i8], align 1
@txn_table = external global %class.TxnTable, align 8
@.str.7 = external hidden unnamed_addr constant [16 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Row_ts15return_req_listEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96), ptr 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

declare noundef i64 @_Z13get_sys_clockv() #3

; 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
declare dso_local noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypem(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, i64 noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Row_ts13update_bufferEm(ptr noundef nonnull align 8 dereferenceable(96) %0, i64 noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %15 = load ptr, ptr %3, align 8
  br label %16

16:                                               ; preds = %174, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %17 = call noundef i64 @_ZN6Row_ts7cal_minE6TsType(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 2)
  store i64 %17, ptr %5, align 8, !tbaa !9
  %18 = load i64, ptr %5, align 8, !tbaa !9
  %19 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 7
  %20 = load i64, ptr %19, align 8, !tbaa !11
  %21 = icmp uge i64 %18, %20
  br i1 %21, label %22, label %23

22:                                               ; preds = %16
  br label %25

23:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 272, ptr noundef @__PRETTY_FUNCTION__._ZN6Row_ts13update_bufferEm) #6
  unreachable

24:                                               ; No predecessors!
  br label %25

25:                                               ; preds = %24, %22
  %26 = load i64, ptr %5, align 8, !tbaa !9
  %27 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 7
  %28 = load i64, ptr %27, align 8, !tbaa !11
  %29 = icmp ugt i64 %26, %28
  br i1 %29, label %30, label %33

30:                                               ; preds = %25
  %31 = load i64, ptr %5, align 8, !tbaa !9
  %32 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 7
  store i64 %31, ptr %32, align 8, !tbaa !11
  br label %34

33:                                               ; preds = %25
  store i32 3, ptr %6, align 4
  br label %172

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %35 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 7
  %36 = load i64, ptr %35, align 8, !tbaa !11
  %37 = call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypem(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 0, i64 noundef %36)
  store ptr %37, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %34
  store i32 3, ptr %6, align 4
  br label %171

41:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %42, ptr %8, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %65, %41
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %101

46:                                               ; preds = %43
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.TsReqEntry, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  %50 = getelementptr inbounds %class.TxnManager, ptr %49, i32 0, i32 4
  %51 = load volatile ptr, ptr %50, align 8, !tbaa !16
  %52 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !24
  call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %51, ptr noundef %53)
  %54 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 4
  %55 = load i64, ptr %54, align 8, !tbaa !25
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.TsReqEntry, ptr %56, i32 0, i32 3
  %58 = load i64, ptr %57, align 8, !tbaa !26
  %59 = icmp ult i64 %55, %58
  br i1 %59, label %60, label %65

60:                                               ; preds = %46
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.TsReqEntry, ptr %61, i32 0, i32 3
  %63 = load i64, ptr %62, align 8, !tbaa !26
  %64 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 4
  store i64 %63, ptr %64, align 8, !tbaa !25
  br label %65

65:                                               ; preds = %60, %46
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.TsReqEntry, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !14
  %69 = getelementptr inbounds %class.TxnManager, ptr %68, i32 0, i32 6
  store volatile i8 1, ptr %69, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %70 = call noundef i64 @_Z13get_sys_clockv()
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.TsReqEntry, ptr %71, i32 0, i32 4
  %73 = load i64, ptr %72, align 8, !tbaa !28
  %74 = sub i64 %70, %73
  store i64 %74, ptr %9, align 8, !tbaa !9
  %75 = load i64, ptr %9, align 8, !tbaa !9
  %76 = uitofp i64 %75 to double
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.TsReqEntry, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !14
  %80 = getelementptr inbounds %class.TxnManager, ptr %79, i32 0, i32 25
  %81 = getelementptr inbounds %class.TxnStats, ptr %80, i32 0, i32 19
  %82 = load double, ptr %81, align 8, !tbaa !29
  %83 = fadd double %82, %76
  store double %83, ptr %81, align 8, !tbaa !29
  %84 = load i64, ptr %9, align 8, !tbaa !9
  %85 = uitofp i64 %84 to double
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.TsReqEntry, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !14
  %89 = getelementptr inbounds %class.TxnManager, ptr %88, i32 0, i32 25
  %90 = getelementptr inbounds %class.TxnStats, ptr %89, i32 0, i32 25
  %91 = load double, ptr %90, align 8, !tbaa !30
  %92 = fadd double %91, %85
  store double %92, ptr %90, align 8, !tbaa !30
  %93 = load i64, ptr %4, align 8, !tbaa !9
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.TsReqEntry, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !14
  %97 = call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %96)
  call void @_ZN8TxnTable11restart_txnEmmm(ptr noundef nonnull align 8 dereferenceable(16) @txn_table, i64 noundef %93, i64 noundef %97, i64 noundef 0)
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.TsReqEntry, ptr %98, i32 0, i32 5
  %100 = load ptr, ptr %99, align 8, !tbaa !31
  store ptr %100, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %43, !llvm.loop !32

101:                                              ; preds = %43
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6Row_ts15return_req_listEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %15, ptr noundef %102)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %103 = call noundef i64 @_ZN6Row_ts7cal_minE6TsType(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 0)
  store i64 %103, ptr %10, align 8, !tbaa !9
  %104 = load i64, ptr %10, align 8, !tbaa !9
  %105 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 6
  %106 = load i64, ptr %105, align 8, !tbaa !34
  %107 = icmp ugt i64 %104, %106
  br i1 %107, label %108, label %111

108:                                              ; preds = %101
  %109 = load i64, ptr %10, align 8, !tbaa !9
  %110 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 6
  store i64 %109, ptr %110, align 8, !tbaa !34
  br label %112

111:                                              ; preds = %101
  store i32 3, ptr %6, align 4
  br label %170

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %113 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 6
  %114 = load i64, ptr %113, align 8, !tbaa !34
  %115 = call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypem(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 1, i64 noundef %114)
  store ptr %115, ptr %11, align 8, !tbaa !5
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = icmp eq ptr %116, null
  br i1 %117, label %118, label %119

118:                                              ; preds = %112
  store i32 3, ptr %6, align 4
  br label %169

119:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 -1, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !5
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %120, ptr %8, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %146, %119
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %150

124:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.TsReqEntry, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !14
  %128 = call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(96) %15, i32 noundef 2, ptr noundef %127)
  store ptr %128, ptr %14, align 8, !tbaa !5
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = icmp ne ptr %129, null
  br i1 %130, label %131, label %132

131:                                              ; preds = %124
  br label %134

132:                                              ; preds = %124
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 308, ptr noundef @__PRETTY_FUNCTION__._ZN6Row_ts13update_bufferEm) #6
  unreachable

133:                                              ; No predecessors!
  br label %134

134:                                              ; preds = %133, %131
  %135 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN6Row_ts16return_req_entryEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %15, ptr noundef %135)
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.TsReqEntry, ptr %136, i32 0, i32 3
  %138 = load i64, ptr %137, align 8, !tbaa !26
  %139 = load i64, ptr %12, align 8, !tbaa !9
  %140 = icmp ult i64 %138, %139
  br i1 %140, label %141, label %146

141:                                              ; preds = %134
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.TsReqEntry, ptr %142, i32 0, i32 3
  %144 = load i64, ptr %143, align 8, !tbaa !26
  store i64 %144, ptr %12, align 8, !tbaa !9
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %145, ptr %13, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %141, %134
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.TsReqEntry, ptr %147, i32 0, i32 5
  %149 = load ptr, ptr %148, align 8, !tbaa !31
  store ptr %149, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %121, !llvm.loop !35

150:                                              ; preds = %121
  %151 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 2
  %152 = load ptr, ptr %151, align 8, !tbaa !24
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.TsReqEntry, ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !36
  call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %152, ptr noundef %155)
  %156 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 3
  %157 = load i64, ptr %156, align 8, !tbaa !37
  %158 = load ptr, ptr %13, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.TsReqEntry, ptr %158, i32 0, i32 3
  %160 = load i64, ptr %159, align 8, !tbaa !26
  %161 = icmp ult i64 %157, %160
  br i1 %161, label %162, label %167

162:                                              ; preds = %150
  %163 = load ptr, ptr %13, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.TsReqEntry, ptr %163, i32 0, i32 3
  %165 = load i64, ptr %164, align 8, !tbaa !26
  %166 = getelementptr inbounds %class.Row_ts, ptr %15, i32 0, i32 3
  store i64 %165, ptr %166, align 8, !tbaa !37
  br label %167

167:                                              ; preds = %162, %150
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN6Row_ts15return_req_listEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %15, ptr noundef %168)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  store i32 0, ptr %6, align 4
  br label %169

169:                                              ; preds = %167, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %170

170:                                              ; preds = %169, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %171

171:                                              ; preds = %170, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %172

172:                                              ; preds = %171, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %173 = load i32, ptr %6, align 4
  switch i32 %173, label %176 [
    i32 0, label %174
    i32 3, label %175
  ]

174:                                              ; preds = %172
  br label %16, !llvm.loop !38

175:                                              ; preds = %172
  ret void

176:                                              ; preds = %172
  unreachable
}

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 = { 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 }
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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 56}
!12 = !{!"_ZTS6Row_ts", !6, i64 0, !13, i64 8, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTS10TsReqEntry", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 32, !6, i64 40}
!16 = !{!17, !6, i64 32}
!17 = !{!"_ZTS10TxnManager", !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !18, i64 40, !13, i64 44, !18, i64 48, !18, i64 52, !13, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !10, i64 120, !13, i64 128, !13, i64 129, !6, i64 136, !6, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !19, i64 176, !18, i64 432, !18, i64 436, !18, i64 440, !13, i64 444, !21, i64 448, !22, i64 456, !18, i64 480, !6, i64 488, !6, i64 496, !23, i64 504, !7, i64 512}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTS8TxnStats", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !20, i64 40, !20, i64 48, !20, i64 56, !20, i64 64, !20, i64 72, !20, i64 80, !20, i64 88, !20, i64 96, !20, i64 104, !20, i64 112, !20, i64 120, !20, i64 128, !20, i64 136, !20, i64 144, !20, i64 152, !20, i64 160, !20, i64 168, !10, i64 176, !10, i64 184, !20, i64 192, !20, i64 200, !20, i64 208, !20, i64 216, !20, i64 224, !20, i64 232, !20, i64 240, !20, i64 248}
!20 = !{!"double", !7, i64 0}
!21 = !{!"_ZTS12CALVIN_PHASE", !7, i64 0}
!22 = !{!"_ZTS5ArrayIP5row_tE", !6, i64 0, !10, i64 8, !10, i64 16}
!23 = !{!"_ZTS8access_t", !7, i64 0}
!24 = !{!12, !6, i64 16}
!25 = !{!12, !10, i64 32}
!26 = !{!15, !10, i64 24}
!27 = !{!17, !13, i64 44}
!28 = !{!15, !10, i64 32}
!29 = !{!17, !20, i64 328}
!30 = !{!17, !20, i64 376}
!31 = !{!15, !6, i64 40}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!12, !10, i64 48}
!35 = distinct !{!35, !33}
!36 = !{!15, !6, i64 8}
!37 = !{!12, !10, i64 24}
!38 = distinct !{!38, !33}


; 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 [78 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN6Row_ts13update_bufferEm = external hidden unnamed_addr constant [37 x i8], align 1
@txn_table = external global %class.TxnTable, align 8
@.str.7 = external hidden unnamed_addr constant [16 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

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

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #2

; 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
declare dso_local noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypem(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, i64 noundef) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Row_ts13update_bufferEm(ptr noundef nonnull align 8 dereferenceable(96) %0, i64 noundef %1) local_unnamed_addr #0 align 2 {
  %3 = tail call noundef i64 @_ZN6Row_ts7cal_minE6TsType(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 2)
  %4 = getelementptr inbounds i8, ptr %0, i64 56
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %.not64 = icmp ult i64 %3, %5
  br i1 %.not64, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  br label %10

._crit_edge:                                      ; preds = %69, %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 272, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6Row_ts13update_bufferEm) #5
  unreachable

10:                                               ; preds = %.lr.ph, %69
  %11 = phi i64 [ %5, %.lr.ph ], [ %71, %69 ]
  %12 = phi i64 [ %3, %.lr.ph ], [ %70, %69 ]
  %13 = icmp ugt i64 %12, %11
  br i1 %13, label %14, label %72

14:                                               ; preds = %10
  store i64 %12, ptr %4, align 8, !tbaa !5
  %15 = tail call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypem(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 0, i64 noundef %12)
  %16 = icmp eq ptr %15, null
  br i1 %16, label %72, label %.preheader58

.preheader58:                                     ; preds = %14, %26
  %.04160 = phi ptr [ %43, %26 ], [ %15, %14 ]
  %17 = load ptr, ptr %.04160, align 8, !tbaa !12
  %18 = getelementptr inbounds i8, ptr %17, i64 32
  %19 = load volatile ptr, ptr %18, align 8, !tbaa !14
  %20 = load ptr, ptr %6, align 8, !tbaa !22
  tail call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %19, ptr noundef %20)
  %21 = load i64, ptr %7, align 8, !tbaa !23
  %22 = getelementptr inbounds i8, ptr %.04160, i64 24
  %23 = load i64, ptr %22, align 8, !tbaa !24
  %24 = icmp ult i64 %21, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %.preheader58
  store i64 %23, ptr %7, align 8, !tbaa !23
  br label %26

26:                                               ; preds = %25, %.preheader58
  %27 = load ptr, ptr %.04160, align 8, !tbaa !12
  %28 = getelementptr inbounds i8, ptr %27, i64 44
  store volatile i8 1, ptr %28, align 4, !tbaa !25
  %29 = tail call noundef i64 @_Z13get_sys_clockv()
  %30 = getelementptr inbounds i8, ptr %.04160, i64 32
  %31 = load i64, ptr %30, align 8, !tbaa !26
  %32 = sub i64 %29, %31
  %33 = uitofp i64 %32 to double
  %34 = load ptr, ptr %.04160, align 8, !tbaa !12
  %35 = getelementptr inbounds i8, ptr %34, i64 328
  %36 = load double, ptr %35, align 8, !tbaa !27
  %37 = fadd double %36, %33
  store double %37, ptr %35, align 8, !tbaa !27
  %38 = getelementptr inbounds i8, ptr %34, i64 376
  %39 = load double, ptr %38, align 8, !tbaa !28
  %40 = fadd double %39, %33
  store double %40, ptr %38, align 8, !tbaa !28
  %41 = tail call noundef i64 @_ZN10TxnManager10get_txn_idEv(ptr noundef nonnull align 8 dereferenceable(544) %34)
  tail call void @_ZN8TxnTable11restart_txnEmmm(ptr noundef nonnull align 8 dereferenceable(16) @txn_table, i64 noundef %1, i64 noundef %41, i64 noundef 0)
  %42 = getelementptr inbounds i8, ptr %.04160, i64 40
  %43 = load ptr, ptr %42, align 8, !tbaa !29
  %.not52 = icmp eq ptr %43, null
  br i1 %.not52, label %44, label %.preheader58, !llvm.loop !30

44:                                               ; preds = %26
  tail call void @_ZN6Row_ts15return_req_listEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %15)
  %45 = tail call noundef i64 @_ZN6Row_ts7cal_minE6TsType(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 0)
  %46 = load i64, ptr %8, align 8, !tbaa !32
  %47 = icmp ugt i64 %45, %46
  br i1 %47, label %48, label %72

48:                                               ; preds = %44
  store i64 %45, ptr %8, align 8, !tbaa !32
  %49 = tail call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypem(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 1, i64 noundef %45)
  %50 = icmp eq ptr %49, null
  br i1 %50, label %72, label %.preheader

.preheader:                                       ; preds = %48, %54
  %.03763 = phi ptr [ %spec.select55, %54 ], [ null, %48 ]
  %.03962 = phi i64 [ %spec.select, %54 ], [ -1, %48 ]
  %.14261 = phi ptr [ %59, %54 ], [ %49, %48 ]
  %51 = load ptr, ptr %.14261, align 8, !tbaa !12
  %52 = tail call noundef ptr @_ZN6Row_ts12debuffer_reqE6TsTypeP10TxnManager(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 2, ptr noundef %51)
  %.not54 = icmp eq ptr %52, null
  br i1 %.not54, label %53, label %54

53:                                               ; preds = %.preheader
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 308, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6Row_ts13update_bufferEm) #5
  unreachable

54:                                               ; preds = %.preheader
  tail call void @_ZN6Row_ts16return_req_entryEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %52)
  %55 = getelementptr inbounds i8, ptr %.14261, i64 24
  %56 = load i64, ptr %55, align 8, !tbaa !24
  %57 = icmp ult i64 %56, %.03962
  %spec.select = tail call i64 @llvm.umin.i64(i64 %56, i64 %.03962)
  %spec.select55 = select i1 %57, ptr %.14261, ptr %.03763
  %58 = getelementptr inbounds i8, ptr %.14261, i64 40
  %59 = load ptr, ptr %58, align 8, !tbaa !29
  %.not53 = icmp eq ptr %59, null
  br i1 %.not53, label %60, label %.preheader, !llvm.loop !33

60:                                               ; preds = %54
  %61 = load ptr, ptr %6, align 8, !tbaa !22
  %62 = getelementptr inbounds i8, ptr %spec.select55, i64 8
  %63 = load ptr, ptr %62, align 8, !tbaa !34
  tail call void @_ZN5row_t4copyEPS_(ptr noundef nonnull align 8 dereferenceable(64) %61, ptr noundef %63)
  %64 = load i64, ptr %9, align 8, !tbaa !35
  %65 = getelementptr inbounds i8, ptr %spec.select55, i64 24
  %66 = load i64, ptr %65, align 8, !tbaa !24
  %67 = icmp ult i64 %64, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %60
  store i64 %66, ptr %9, align 8, !tbaa !35
  br label %69

69:                                               ; preds = %60, %68
  tail call void @_ZN6Row_ts15return_req_listEP10TsReqEntry(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %49)
  %70 = tail call noundef i64 @_ZN6Row_ts7cal_minE6TsType(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef 2)
  %71 = load i64, ptr %4, align 8, !tbaa !5
  %.not = icmp ult i64 %70, %71
  br i1 %.not, label %._crit_edge, label %10

72:                                               ; preds = %10, %14, %44, %48
  ret void
}

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

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


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