; LLVM IR from pmwkaa/monotone :: monotone/engine/engine (op)

; 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.Runtime = type { %struct.ExceptionMgr, %struct.Error, ptr }
%struct.ExceptionMgr = type { ptr }
%struct.Error = type { [256 x i8], i32, ptr, ptr, i32, ptr, ptr }
%struct.Guard = type { ptr, ptr, ptr }
%struct.Context = type { ptr, ptr, ptr }
%struct.Global = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.Config = type { %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.List, %struct.List, i32, i32, i32, i32 }
%struct.Var = type { i32, i32, %struct.Str, %struct.List, %struct.List, %union.anon }
%struct.Str = type { ptr, ptr, i8 }
%union.anon = type { %struct.Str }
%struct.List = type { ptr, ptr }
%struct.Exception = type { ptr, i8, ptr, [1 x %struct.__jmp_buf_tag] }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.Engine = type { %struct.Mutex, %struct.CondVar, %struct.Mapping, %struct.Pipeline, %struct.StorageMgr, ptr, ptr, ptr }
%struct.Mutex = type { %union.pthread_mutex_t }
%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 }
%struct.CondVar = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%struct.Mapping = type { %struct.Rbtree, i32 }
%struct.Rbtree = type { ptr }
%struct.Pipeline = type { %struct.List, i32, ptr }
%struct.StorageMgr = type { %struct.List, i32, ptr }
%struct.Ref = type { ptr, %struct.Lockage, %struct.Slice }
%struct.Lockage = type { [2 x %struct.Lock], ptr, ptr }
%struct.Lock = type { i64, i32, i32 }
%struct.Slice = type { i64, i64, %struct.RbtreeNode }
%struct.RbtreeNode = type { ptr, ptr, ptr, i8 }
%struct.Part = type { %struct.Id, i32, i64, i64, i8, ptr, %struct.Memtable, %struct.Memtable, %struct.File, %struct.Index, %struct.Buf, ptr, ptr, ptr, %struct.List }
%struct.Id = type { i64, i64 }
%struct.Memtable = type { ptr, %struct.Rbtree, i32, i32, i32, i64, i64, i64, %struct.List, i32, %struct.Heap }
%struct.Heap = type { ptr, ptr, i32, ptr }
%struct.File = type { i32, i64, %struct.Str, %struct.List }
%struct.Index = type <{ i32, i32, i32, i32, %struct.Id, i32, i32, i64, i64, i64, i64, i32, i64, i64, i64, i32, i64, i8, i8, [4 x i32] }>
%struct.Buf = type { ptr, ptr, ptr }

@mn_runtime = external thread_local global %struct.Runtime, align 8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; 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: alwaysinline nounwind uwtable
declare hidden void @guard_runner(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mapping_next(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_lock_shared() #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_unlock_guard(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mutex_lock(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mutex_unlock(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mapping_min(ptr noundef) #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden ptr @ref_of(ptr noundef) #2

; Function Attrs: hot nounwind uwtable
define dso_local void @engine_gc(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.Guard, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %13 = getelementptr inbounds %struct.Runtime, ptr %12, i32 0, i32 2
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds %struct.Context, ptr %14, i32 0, i32 2
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = getelementptr inbounds %struct.Global, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !16
  %19 = getelementptr inbounds %struct.Config, ptr %18, i32 0, i32 13
  %20 = call i64 @var_int_of(ptr noundef %19)
  %21 = icmp ne i64 %20, 0
  br i1 %21, label %23, label %22

22:                                               ; preds = %1
  br label %84

23:                                               ; preds = %1
  call void @control_lock_shared()
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  %24 = getelementptr inbounds %struct.Guard, ptr %3, i32 0, i32 0
  store ptr @control_unlock_guard, ptr %24, align 8, !tbaa !18
  %25 = getelementptr inbounds %struct.Guard, ptr %3, i32 0, i32 1
  store ptr null, ptr %25, align 8, !tbaa !20
  %26 = getelementptr inbounds %struct.Guard, ptr %3, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %27 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %28 = getelementptr inbounds %struct.Runtime, ptr %27, i32 0, i32 0
  %29 = getelementptr inbounds %struct.ExceptionMgr, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  store ptr %30, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.Exception, ptr %31, i32 0, i32 2
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  store ptr %33, ptr %5, align 8, !tbaa !5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.Exception, ptr %34, i32 0, i32 2
  store ptr %3, ptr %35, align 8, !tbaa !22
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %36, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %37, ptr %26, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 -1, ptr %7, align 8, !tbaa !26
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Engine, ptr %38, i32 0, i32 0
  call void @mutex_lock(ptr noundef %39)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.Engine, ptr %40, i32 0, i32 2
  %42 = call ptr @mapping_min(ptr noundef %41)
  store ptr %42, ptr %8, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %72, %23
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %77

46:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = call ptr @ref_of(ptr noundef %47)
  store ptr %48, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.Ref, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !28
  %52 = getelementptr inbounds %struct.Part, ptr %51, i32 0, i32 6
  %53 = getelementptr inbounds %struct.Memtable, ptr %52, i32 0, i32 6
  %54 = call i64 @atomic_u64_of(ptr noundef %53)
  store i64 %54, ptr %10, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Ref, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !28
  %58 = getelementptr inbounds %struct.Part, ptr %57, i32 0, i32 7
  %59 = getelementptr inbounds %struct.Memtable, ptr %58, i32 0, i32 6
  %60 = call i64 @atomic_u64_of(ptr noundef %59)
  store i64 %60, ptr %11, align 8, !tbaa !26
  %61 = load i64, ptr %10, align 8, !tbaa !26
  %62 = load i64, ptr %7, align 8, !tbaa !26
  %63 = icmp ult i64 %61, %62
  br i1 %63, label %64, label %66

64:                                               ; preds = %46
  %65 = load i64, ptr %10, align 8, !tbaa !26
  store i64 %65, ptr %7, align 8, !tbaa !26
  br label %66

66:                                               ; preds = %64, %46
  %67 = load i64, ptr %11, align 8, !tbaa !26
  %68 = load i64, ptr %7, align 8, !tbaa !26
  %69 = icmp ult i64 %67, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %66
  %71 = load i64, ptr %11, align 8, !tbaa !26
  store i64 %71, ptr %7, align 8, !tbaa !26
  br label %72

72:                                               ; preds = %70, %66
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.Engine, ptr %73, i32 0, i32 2
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = call ptr @mapping_next(ptr noundef %74, ptr noundef %75)
  store ptr %76, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %43, !llvm.loop !33

77:                                               ; preds = %43
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.Engine, ptr %78, i32 0, i32 0
  call void @mutex_unlock(ptr noundef %79)
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.Engine, ptr %80, i32 0, i32 5
  %82 = load ptr, ptr %81, align 8, !tbaa !35
  %83 = load i64, ptr %7, align 8, !tbaa !26
  call void @wal_gc(ptr noundef %82, i64 noundef %83)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @guard_runner(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  br label %84

84:                                               ; preds = %77, %22
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @var_int_of(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @atomic_u64_of(ptr noundef) #3

declare void @wal_gc(ptr noundef, i64 noundef) #5

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

!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/C++ TBAA"}
!9 = !{!10, !6, i64 312}
!10 = !{!"Runtime", !11, i64 0, !12, i64 8, !6, i64 312}
!11 = !{!"ExceptionMgr", !6, i64 0}
!12 = !{!"Error", !7, i64 0, !13, i64 256, !6, i64 264, !6, i64 272, !13, i64 280, !6, i64 288, !6, i64 296}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 16}
!15 = !{!"Context", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!17, !6, i64 0}
!17 = !{!"Global", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!18 = !{!19, !6, i64 0}
!19 = !{!"Guard", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!19, !6, i64 8}
!21 = !{!10, !6, i64 0}
!22 = !{!23, !6, i64 16}
!23 = !{!"Exception", !6, i64 0, !24, i64 8, !6, i64 16, !7, i64 24}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{!19, !6, i64 16}
!26 = !{!27, !27, i64 0}
!27 = !{!"long", !7, i64 0}
!28 = !{!29, !6, i64 0}
!29 = !{!"Ref", !6, i64 0, !30, i64 8, !31, i64 56}
!30 = !{!"Lockage", !7, i64 0, !6, i64 32, !6, i64 40}
!31 = !{!"Slice", !27, i64 0, !27, i64 8, !32, i64 16}
!32 = !{!"RbtreeNode", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!36, !6, i64 168}
!36 = !{!"Engine", !37, i64 0, !38, i64 40, !39, i64 88, !41, i64 104, !43, i64 136, !6, i64 168, !6, i64 176, !6, i64 184}
!37 = !{!"Mutex", !7, i64 0}
!38 = !{!"CondVar", !7, i64 0}
!39 = !{!"Mapping", !40, i64 0, !13, i64 8}
!40 = !{!"Rbtree", !6, i64 0}
!41 = !{!"Pipeline", !42, i64 0, !13, i64 16, !6, i64 24}
!42 = !{!"List", !6, i64 0, !6, i64 8}
!43 = !{!"StorageMgr", !42, i64 0, !13, i64 16, !6, i64 24}


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

%struct.Runtime = type { %struct.ExceptionMgr, %struct.Error, ptr }
%struct.ExceptionMgr = type { ptr }
%struct.Error = type { [256 x i8], i32, ptr, ptr, i32, ptr, ptr }
%struct.Guard = type { ptr, ptr, ptr }

@mn_runtime = external thread_local local_unnamed_addr global %struct.Runtime, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @guard_runner(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mapping_next(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_lock_shared() local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_unlock_guard(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mutex_lock(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mutex_unlock(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mapping_min(ptr noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden ptr @ref_of(ptr noundef) local_unnamed_addr #2

; Function Attrs: hot nounwind uwtable
define dso_local void @engine_gc(ptr noundef %0) local_unnamed_addr #4 {
  %2 = alloca %struct.Guard, align 8
  %3 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %4 = getelementptr inbounds i8, ptr %3, i64 312
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !13
  %8 = load ptr, ptr %7, align 8, !tbaa !15
  %9 = getelementptr inbounds i8, ptr %8, i64 1144
  %10 = tail call i64 @var_int_of(ptr noundef nonnull %9)
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %29, label %11

11:                                               ; preds = %1
  tail call void @control_lock_shared()
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  store ptr @control_unlock_guard, ptr %2, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr null, ptr %12, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %2, i64 16
  %14 = load ptr, ptr %3, align 8, !tbaa !20
  %15 = getelementptr inbounds i8, ptr %14, i64 16
  %16 = load ptr, ptr %15, align 8, !tbaa !21
  store ptr %2, ptr %15, align 8, !tbaa !21
  store ptr %16, ptr %13, align 8, !tbaa !24
  call void @mutex_lock(ptr noundef %0)
  %17 = getelementptr inbounds i8, ptr %0, i64 88
  %18 = call ptr @mapping_min(ptr noundef nonnull %17)
  %.not2324 = icmp eq ptr %18, null
  br i1 %.not2324, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11, %.lr.ph
  %.026 = phi i64 [ %.2, %.lr.ph ], [ -1, %11 ]
  %.02025 = phi ptr [ %26, %.lr.ph ], [ %18, %11 ]
  %19 = call ptr @ref_of(ptr noundef nonnull %.02025)
  %20 = load ptr, ptr %19, align 8, !tbaa !25
  %21 = getelementptr inbounds i8, ptr %20, i64 96
  %22 = call i64 @atomic_u64_of(ptr noundef nonnull %21)
  %23 = load ptr, ptr %19, align 8, !tbaa !25
  %24 = getelementptr inbounds i8, ptr %23, i64 208
  %25 = call i64 @atomic_u64_of(ptr noundef nonnull %24)
  %spec.select = call i64 @llvm.umin.i64(i64 %22, i64 %.026)
  %.2 = call i64 @llvm.umin.i64(i64 %25, i64 %spec.select)
  %26 = call ptr @mapping_next(ptr noundef nonnull %17, ptr noundef nonnull %.02025)
  %.not23 = icmp eq ptr %26, null
  br i1 %.not23, label %._crit_edge, label %.lr.ph, !llvm.loop !31

._crit_edge:                                      ; preds = %.lr.ph, %11
  %.0.lcssa = phi i64 [ -1, %11 ], [ %.2, %.lr.ph ]
  call void @mutex_unlock(ptr noundef %0)
  %27 = getelementptr inbounds i8, ptr %0, i64 168
  %28 = load ptr, ptr %27, align 8, !tbaa !33
  call void @wal_gc(ptr noundef %28, i64 noundef %.0.lcssa) #7
  call void @guard_runner(ptr noundef nonnull %2)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  br label %29

29:                                               ; preds = %1, %._crit_edge
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @var_int_of(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @atomic_u64_of(ptr noundef) local_unnamed_addr #3

declare void @wal_gc(ptr noundef, i64 noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline 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 #3 = { inlinehint 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 = { hot 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 = { "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 nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 312}
!6 = !{!"Runtime", !7, i64 0, !11, i64 8, !8, i64 312}
!7 = !{!"ExceptionMgr", !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"Error", !9, i64 0, !12, i64 256, !8, i64 264, !8, i64 272, !12, i64 280, !8, i64 288, !8, i64 296}
!12 = !{!"int", !9, i64 0}
!13 = !{!14, !8, i64 16}
!14 = !{!"Context", !8, i64 0, !8, i64 8, !8, i64 16}
!15 = !{!16, !8, i64 0}
!16 = !{!"Global", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48}
!17 = !{!18, !8, i64 0}
!18 = !{!"Guard", !8, i64 0, !8, i64 8, !8, i64 16}
!19 = !{!18, !8, i64 8}
!20 = !{!6, !8, i64 0}
!21 = !{!22, !8, i64 16}
!22 = !{!"Exception", !8, i64 0, !23, i64 8, !8, i64 16, !9, i64 24}
!23 = !{!"_Bool", !9, i64 0}
!24 = !{!18, !8, i64 16}
!25 = !{!26, !8, i64 0}
!26 = !{!"Ref", !8, i64 0, !27, i64 8, !28, i64 56}
!27 = !{!"Lockage", !9, i64 0, !8, i64 32, !8, i64 40}
!28 = !{!"Slice", !29, i64 0, !29, i64 8, !30, i64 16}
!29 = !{!"long", !9, i64 0}
!30 = !{!"RbtreeNode", !8, i64 0, !8, i64 8, !8, i64 16, !9, i64 24}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!34, !8, i64 168}
!34 = !{!"Engine", !35, i64 0, !36, i64 40, !37, i64 88, !39, i64 104, !41, i64 136, !8, i64 168, !8, i64 176, !8, i64 184}
!35 = !{!"Mutex", !9, i64 0}
!36 = !{!"CondVar", !9, i64 0}
!37 = !{!"Mapping", !38, i64 0, !12, i64 8}
!38 = !{!"Rbtree", !8, i64 0}
!39 = !{!"Pipeline", !40, i64 0, !12, i64 16, !8, i64 24}
!40 = !{!"List", !8, i64 0, !8, i64 8}
!41 = !{!"StorageMgr", !40, i64 0, !12, i64 16, !8, i64 24}


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