; LLVM IR from cruppstahl/upscaledb :: src/4txn/txn_cursor.ll (ZN9upscaledb9TxnCursor16copy_coupled_keyEP9ups_key_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"

%"struct.upscaledb::TxnCursor" = type { %"struct.upscaledb::TxnCursorState" }
%"struct.upscaledb::TxnCursorState" = type { ptr, ptr, ptr, ptr }
%"struct.upscaledb::Cursor" = type { ptr, ptr, ptr, ptr, ptr }
%"struct.upscaledb::TxnOperation" = type { ptr, ptr, i32, i32, i32, i64, ptr, ptr, ptr, ptr, ptr, %struct.ups_key_t, %struct.ups_record_t, [1 x i8] }
%struct.ups_key_t = type { i16, ptr, i32, i32 }
%struct.ups_record_t = type { i32, ptr, i32 }
%"struct.upscaledb::TxnNode" = type { %struct.anon, ptr, ptr, ptr, ptr }
%struct.anon = type { ptr, ptr, i8 }

@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@_ZTIN9upscaledb9ExceptionE = external dso_local constant { ptr, ptr }, align 8
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN9upscaledb9TxnCursor16copy_coupled_keyEP9ups_key_t = external hidden unnamed_addr constant [57 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN9upscaledbL2dbERNS_14TxnCursorStateE(ptr noundef nonnull align 8 dereferenceable(32)) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9upscaledb9TxnCursor16copy_coupled_keyEP9ups_key_t(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) #5 align 2 personality ptr @__gxx_personality_v0 {
  %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 i32, align 4
  %10 = alloca ptr, 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) #7
  %12 = getelementptr inbounds %"struct.upscaledb::TxnCursor", ptr %11, i32 0, i32 0
  %13 = getelementptr inbounds %"struct.upscaledb::TxnCursorState", ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds %"struct.upscaledb::Cursor", ptr %14, i32 0, i32 2
  %16 = load ptr, ptr %15, align 8, !tbaa !12
  store ptr %16, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %17 = getelementptr inbounds %"struct.upscaledb::TxnCursor", ptr %11, i32 0, i32 0
  %18 = call noundef ptr @_ZN9upscaledbL2dbERNS_14TxnCursorStateE(ptr noundef nonnull align 8 dereferenceable(32) %17)
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef nonnull align 8 dereferenceable(17) ptr @_ZN9upscaledb2Db9key_arenaEPNS_3TxnE(ptr noundef nonnull align 8 dereferenceable(160) %18, ptr noundef %19)
  store ptr %20, ptr %7, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZNK9upscaledb9TxnCursor6is_nilEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  %22 = zext i1 %21 to i64
  %23 = call i64 @llvm.expect.i64(i64 %22, i64 0)
  %24 = icmp ne i64 %23, 0
  br i1 %24, label %25, label %32

25:                                               ; preds = %2
  %26 = call ptr @__cxa_allocate_exception(i64 4) #7
  invoke void @_ZN9upscaledb9ExceptionC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %26, i32 noundef -100)
          to label %27 unwind label %28

27:                                               ; preds = %25
  call void @__cxa_throw(ptr %26, ptr @_ZTIN9upscaledb9ExceptionE, ptr null) #8
  unreachable

28:                                               ; preds = %25
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %8, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %9, align 4
  call void @__cxa_free_exception(ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %101

32:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %33 = getelementptr inbounds %"struct.upscaledb::TxnCursor", ptr %11, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.upscaledb::TxnCursorState", ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds %"struct.upscaledb::TxnOperation", ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !15
  store ptr %37, ptr %10, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.upscaledb::TxnCursor", ptr %11, i32 0, i32 0
  %39 = call noundef ptr @_ZN9upscaledbL2dbERNS_14TxnCursorStateE(ptr noundef nonnull align 8 dereferenceable(32) %38)
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.upscaledb::TxnNode", ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !22
  %43 = icmp eq ptr %39, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %32
  br label %47

45:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 277, ptr noundef @__PRETTY_FUNCTION__._ZN9upscaledb9TxnCursor16copy_coupled_keyEP9ups_key_t) #9
  unreachable

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %44
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = call noundef ptr @_ZN9upscaledb7TxnNode3keyEv(ptr noundef nonnull align 8 dereferenceable(56) %48)
  store ptr %49, ptr %6, align 8, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ups_key_t, ptr %50, i32 0, i32 0
  %52 = load i16, ptr %51, align 8, !tbaa !26
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ups_key_t, ptr %53, i32 0, i32 0
  store i16 %52, ptr %54, align 8, !tbaa !26
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ups_key_t, ptr %55, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !27
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %64

59:                                               ; preds = %47
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.ups_key_t, ptr %60, i32 0, i32 0
  %62 = load i16, ptr %61, align 8, !tbaa !26
  %63 = icmp ne i16 %62, 0
  br label %64

64:                                               ; preds = %59, %47
  %65 = phi i1 [ false, %47 ], [ %63, %59 ]
  %66 = zext i1 %65 to i64
  %67 = call i64 @llvm.expect.i64(i64 %66, i64 1)
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %69, label %97

69:                                               ; preds = %64
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ups_key_t, ptr %70, i32 0, i32 2
  %72 = load i32, ptr %71, align 8, !tbaa !28
  %73 = and i32 %72, 1
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %86

75:                                               ; preds = %69
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ups_key_t, ptr %77, i32 0, i32 0
  %79 = load i16, ptr %78, align 8, !tbaa !26
  %80 = zext i16 %79 to i64
  %81 = call noundef ptr @_ZN9upscaledb12DynamicArrayIhE6resizeEm(ptr noundef nonnull align 8 dereferenceable(17) %76, i64 noundef %80)
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = call noundef ptr @_ZN9upscaledb12DynamicArrayIhE4dataEv(ptr noundef nonnull align 8 dereferenceable(17) %82)
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.ups_key_t, ptr %84, i32 0, i32 1
  store ptr %83, ptr %85, align 8, !tbaa !27
  br label %86

86:                                               ; preds = %75, %69
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ups_key_t, ptr %87, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !27
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ups_key_t, ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !27
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ups_key_t, ptr %93, i32 0, i32 0
  %95 = load i16, ptr %94, align 8, !tbaa !26
  %96 = zext i16 %95 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %89, ptr align 1 %92, i64 %96, i1 false)
  br label %100

97:                                               ; preds = %64
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ups_key_t, ptr %98, i32 0, i32 1
  store ptr null, ptr %99, align 8, !tbaa !27
  br label %100

100:                                              ; preds = %97, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret void

101:                                              ; preds = %28
  %102 = load ptr, ptr %8, align 8
  %103 = load i32, ptr %9, align 4
  %104 = insertvalue { ptr, i32 } poison, ptr %102, 0
  %105 = insertvalue { ptr, i32 } %104, i32 %103, 1
  resume { ptr, i32 } %105
}

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

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9upscaledb9ExceptionC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #1 align 2

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb12DynamicArrayIhE6resizeEm(ptr noundef nonnull align 8 dereferenceable(17), i64 noundef) #5 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #3 = { inlinehint 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 "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 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }
attributes #9 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN9upscaledb9TxnCursorE", !11, i64 0}
!11 = !{!"_ZTSN9upscaledb14TxnCursorStateE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!12 = !{!13, !6, i64 16}
!13 = !{!"_ZTSN9upscaledb6CursorE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!14 = !{!10, !6, i64 8}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSN9upscaledb12TxnOperationE", !6, i64 0, !6, i64 8, !17, i64 16, !17, i64 20, !17, i64 24, !18, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !19, i64 80, !21, i64 104, !7, i64 128}
!17 = !{!"int", !7, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTS9ups_key_t", !20, i64 0, !6, i64 8, !17, i64 16, !17, i64 20}
!20 = !{!"short", !7, i64 0}
!21 = !{!"_ZTS12ups_record_t", !17, i64 0, !6, i64 8, !17, i64 16}
!22 = !{!23, !6, i64 24}
!23 = !{!"_ZTSN9upscaledb7TxnNodeE", !24, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!24 = !{!"_ZTSN9upscaledb7TxnNodeUt_E", !6, i64 0, !6, i64 8, !25, i64 16}
!25 = !{!"bool", !7, i64 0}
!26 = !{!19, !20, i64 0}
!27 = !{!19, !6, i64 8}
!28 = !{!19, !17, i64 16}


; 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"

@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@_ZTIN9upscaledb9ExceptionE = external dso_local constant { ptr, ptr }, align 8
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN9upscaledb9TxnCursor16copy_coupled_keyEP9ups_key_t = external hidden unnamed_addr constant [57 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK9upscaledb9TxnCursor6is_nilEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN9upscaledbL2dbERNS_14TxnCursorStateE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9upscaledb9TxnCursor16copy_coupled_keyEP9ups_key_t(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr nocapture noundef %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 16
  %5 = load ptr, ptr %4, align 8, !tbaa !11
  %6 = tail call noundef ptr @_ZN9upscaledbL2dbERNS_14TxnCursorStateE(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %7 = tail call noundef nonnull align 8 dereferenceable(17) ptr @_ZN9upscaledb2Db9key_arenaEPNS_3TxnE(ptr noundef nonnull align 8 dereferenceable(160) %6, ptr noundef %5)
  %8 = tail call noundef zeroext i1 @_ZNK9upscaledb9TxnCursor6is_nilEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br i1 %8, label %9, label %11, !prof !13

9:                                                ; preds = %2
  %10 = tail call ptr @__cxa_allocate_exception(i64 4) #5
  tail call void @_ZN9upscaledb9ExceptionC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 noundef -100)
  tail call void @__cxa_throw(ptr nonnull %10, ptr nonnull @_ZTIN9upscaledb9ExceptionE, ptr null) #6
  unreachable

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = tail call noundef ptr @_ZN9upscaledbL2dbERNS_14TxnCursorStateE(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %17 = getelementptr inbounds i8, ptr %15, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !22
  %19 = icmp eq ptr %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 277, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9upscaledb9TxnCursor16copy_coupled_keyEP9ups_key_t) #7
  unreachable

21:                                               ; preds = %11
  %22 = tail call noundef ptr @_ZN9upscaledb7TxnNode3keyEv(ptr noundef nonnull align 8 dereferenceable(56) %15)
  %23 = load i16, ptr %22, align 8, !tbaa !26
  store i16 %23, ptr %1, align 8, !tbaa !26
  %24 = getelementptr inbounds i8, ptr %22, i64 8
  %25 = load ptr, ptr %24, align 8, !tbaa !27
  %.not = icmp eq ptr %25, null
  %.not17 = icmp eq i16 %23, 0
  %or.cond = select i1 %.not, i1 true, i1 %.not17
  br i1 %or.cond, label %.critedge, label %26, !prof !28

26:                                               ; preds = %21
  %27 = getelementptr inbounds i8, ptr %1, i64 16
  %28 = load i32, ptr %27, align 8, !tbaa !29
  %29 = and i32 %28, 1
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %._crit_edge

._crit_edge:                                      ; preds = %26
  %.phi.trans.insert = getelementptr inbounds i8, ptr %1, i64 8
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !27
  br label %36

31:                                               ; preds = %26
  %32 = zext i16 %23 to i64
  %33 = tail call noundef ptr @_ZN9upscaledb12DynamicArrayIhE6resizeEm(ptr noundef nonnull align 8 dereferenceable(17) %7, i64 noundef %32)
  %34 = tail call noundef ptr @_ZN9upscaledb12DynamicArrayIhE4dataEv(ptr noundef nonnull align 8 dereferenceable(17) %7)
  %35 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %34, ptr %35, align 8, !tbaa !27
  %.pre18 = load ptr, ptr %24, align 8, !tbaa !27
  %.pre19 = load i16, ptr %22, align 8, !tbaa !26
  br label %36

36:                                               ; preds = %._crit_edge, %31
  %37 = phi i16 [ %23, %._crit_edge ], [ %.pre19, %31 ]
  %38 = phi ptr [ %25, %._crit_edge ], [ %.pre18, %31 ]
  %39 = phi ptr [ %.pre, %._crit_edge ], [ %34, %31 ]
  %40 = zext i16 %37 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %39, ptr align 1 %38, i64 %40, i1 false)
  br label %42

.critedge:                                        ; preds = %21
  %41 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr null, ptr %41, align 8, !tbaa !27
  br label %42

42:                                               ; preds = %.critedge, %36
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(17) ptr @_ZN9upscaledb2Db9key_arenaEPNS_3TxnE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef) local_unnamed_addr #0 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9upscaledb9ExceptionC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #0 align 2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

attributes #0 = { 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 #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { noreturn }
attributes #7 = { 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, !8, i64 0}
!6 = !{!"_ZTSN9upscaledb9TxnCursorE", !7, i64 0}
!7 = !{!"_ZTSN9upscaledb14TxnCursorStateE", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !8, i64 16}
!12 = !{!"_ZTSN9upscaledb6CursorE", !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32}
!13 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!14 = !{!6, !8, i64 8}
!15 = !{!16, !8, i64 8}
!16 = !{!"_ZTSN9upscaledb12TxnOperationE", !8, i64 0, !8, i64 8, !17, i64 16, !17, i64 20, !17, i64 24, !18, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !19, i64 80, !21, i64 104, !9, i64 128}
!17 = !{!"int", !9, i64 0}
!18 = !{!"long", !9, i64 0}
!19 = !{!"_ZTS9ups_key_t", !20, i64 0, !8, i64 8, !17, i64 16, !17, i64 20}
!20 = !{!"short", !9, i64 0}
!21 = !{!"_ZTS12ups_record_t", !17, i64 0, !8, i64 8, !17, i64 16}
!22 = !{!23, !8, i64 24}
!23 = !{!"_ZTSN9upscaledb7TxnNodeE", !24, i64 0, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48}
!24 = !{!"_ZTSN9upscaledb7TxnNodeUt_E", !8, i64 0, !8, i64 8, !25, i64 16}
!25 = !{!"bool", !9, i64 0}
!26 = !{!19, !20, i64 0}
!27 = !{!19, !8, i64 8}
!28 = !{!"branch_weights", i32 4001, i32 4000000}
!29 = !{!19, !17, i64 16}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass