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

; 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.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.Wal = type { %struct.Mutex, %struct.WalId, 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.WalId = type { %struct.Spinlock, i32, %struct.Buf }
%struct.Spinlock = type { i32 }
%struct.Buf = 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.WalFile = type { i64, %struct.File }
%struct.File = type { i32, i64, %struct.Str, %struct.List }

@mn_runtime = external thread_local global %struct.Runtime, 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: inlinehint nounwind uwtable
declare hidden void @wal_file_close(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @wal_file_free(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: nounwind uwtable
define dso_local void @wal_rotate(ptr noundef %0, i64 noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.Exception, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.Wal, ptr %10, i32 0, i32 0
  call void @mutex_lock(ptr noundef %11)
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = load i64, ptr %4, align 8, !tbaa !9
  %14 = call zeroext i1 @wal_rotate_ready(ptr noundef %12, i64 noundef %13)
  br i1 %14, label %18, label %15

15:                                               ; preds = %2
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.Wal, ptr %16, i32 0, i32 0
  call void @mutex_unlock(ptr noundef %17)
  br label %91

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %19 = call i64 @config_lsn()
  %20 = add i64 %19, 1
  store i64 %20, ptr %5, align 8, !tbaa !9
  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 224, ptr %7) #7
  %21 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %22 = getelementptr inbounds %struct.Runtime, ptr %21, i32 0, i32 0
  %23 = getelementptr inbounds %struct.ExceptionMgr, ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds %struct.Exception, ptr %7, i32 0, i32 0
  store ptr %24, ptr %25, align 8, !tbaa !16
  %26 = getelementptr inbounds %struct.Exception, ptr %7, i32 0, i32 1
  store i8 0, ptr %26, align 8, !tbaa !19
  %27 = getelementptr inbounds %struct.Exception, ptr %7, i32 0, i32 2
  store ptr null, ptr %27, align 8, !tbaa !20
  %28 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %29 = getelementptr inbounds %struct.Runtime, ptr %28, i32 0, i32 0
  %30 = getelementptr inbounds %struct.ExceptionMgr, ptr %29, i32 0, i32 0
  store ptr %7, ptr %30, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.Exception, ptr %7, i32 0, i32 3
  %32 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %31, i64 0, i64 0
  %33 = call i32 @_setjmp(ptr noundef %32) #8
  %34 = icmp eq i32 %33, 0
  %35 = zext i1 %34 to i32
  store i32 %35, ptr %8, align 4, !tbaa !21
  %36 = load i32, ptr %8, align 4, !tbaa !21
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %42

38:                                               ; preds = %18
  %39 = load i64, ptr %5, align 8, !tbaa !9
  %40 = call ptr @wal_file_allocate(i64 noundef %39)
  store ptr %40, ptr %6, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  call void @wal_file_create(ptr noundef %41)
  br label %42

42:                                               ; preds = %38, %18
  %43 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %44 = getelementptr inbounds %struct.Runtime, ptr %43, i32 0, i32 0
  %45 = call zeroext i1 @exception_mgr_leave(ptr noundef %44, ptr noundef %7)
  br i1 %45, label %46, label %57

46:                                               ; preds = %42
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %52

49:                                               ; preds = %46
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  call void @wal_file_close(ptr noundef %50)
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  call void @wal_file_free(ptr noundef %51)
  br label %52

52:                                               ; preds = %49, %46
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Wal, ptr %53, i32 0, i32 0
  call void @mutex_unlock(ptr noundef %54)
  %55 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %56 = getelementptr inbounds %struct.Runtime, ptr %55, i32 0, i32 0
  call void @exception_mgr_throw(ptr noundef %56) #9
  unreachable

57:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.Wal, ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  store ptr %60, ptr %9, align 8, !tbaa !5
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.Wal, ptr %62, i32 0, i32 2
  store ptr %61, ptr %63, align 8, !tbaa !22
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.Wal, ptr %64, i32 0, i32 1
  %66 = load i64, ptr %5, align 8, !tbaa !9
  call void @wal_id_add(ptr noundef %65, i64 noundef %66)
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.Wal, ptr %67, i32 0, i32 0
  call void @mutex_unlock(ptr noundef %68)
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %90

71:                                               ; preds = %57
  %72 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %73 = getelementptr inbounds %struct.Runtime, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !28
  %75 = getelementptr inbounds %struct.Context, ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !29
  %77 = getelementptr inbounds %struct.Global, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !31
  %79 = getelementptr inbounds %struct.Config, ptr %78, i32 0, i32 15
  %80 = call i64 @var_int_of(ptr noundef %79)
  %81 = icmp ne i64 %80, 0
  br i1 %81, label %82, label %87

82:                                               ; preds = %71
  %83 = call zeroext i1 @config_sync()
  br i1 %83, label %84, label %87

84:                                               ; preds = %82
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.WalFile, ptr %85, i32 0, i32 1
  call void @file_sync(ptr noundef %86)
  br label %87

87:                                               ; preds = %84, %82, %71
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  call void @wal_file_close(ptr noundef %88)
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  call void @wal_file_free(ptr noundef %89)
  br label %90

90:                                               ; preds = %87, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 224, 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 %91

91:                                               ; preds = %90, %15
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @wal_rotate_ready(ptr noundef, i64 noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @config_lsn() #1

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

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

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden zeroext i1 @exception_mgr_leave(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @exception_mgr_throw(ptr noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @wal_id_add(ptr noundef, i64 noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @config_sync() #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind returns_twice "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 = { 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 #6 = { inlinehint noreturn 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 #7 = { nounwind }
attributes #8 = { nounwind returns_twice }
attributes #9 = { noreturn }

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"Runtime", !13, i64 0, !14, i64 8, !6, i64 312}
!13 = !{!"ExceptionMgr", !6, i64 0}
!14 = !{!"Error", !7, i64 0, !15, i64 256, !6, i64 264, !6, i64 272, !15, i64 280, !6, i64 288, !6, i64 296}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"Exception", !6, i64 0, !18, i64 8, !6, i64 16, !7, i64 24}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!17, !18, i64 8}
!20 = !{!17, !6, i64 16}
!21 = !{!15, !15, i64 0}
!22 = !{!23, !6, i64 72}
!23 = !{!"Wal", !24, i64 0, !25, i64 40, !6, i64 72}
!24 = !{!"Mutex", !7, i64 0}
!25 = !{!"WalId", !26, i64 0, !15, i64 4, !27, i64 8}
!26 = !{!"Spinlock", !15, i64 0}
!27 = !{!"Buf", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!12, !6, i64 312}
!29 = !{!30, !6, i64 16}
!30 = !{!"Context", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!32, !6, i64 0}
!32 = !{!"Global", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}


; 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.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] }

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @wal_rotate(ptr noundef %0, i64 noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.Exception, align 8
  call void @mutex_lock(ptr noundef %0)
  %4 = call zeroext i1 @wal_rotate_ready(ptr noundef %0, i64 noundef %1)
  br i1 %4, label %6, label %5

5:                                                ; preds = %2
  call void @mutex_unlock(ptr noundef %0)
  br label %40

6:                                                ; preds = %2
  %7 = call i64 @config_lsn()
  %8 = add i64 %7, 1
  call void @llvm.lifetime.start.p0(i64 224, ptr nonnull %3) #7
  %9 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %10, ptr %3, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  store i8 0, ptr %11, align 8, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr null, ptr %12, align 8, !tbaa !17
  store ptr %3, ptr %9, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %3, i64 24
  %14 = call i32 @_setjmp(ptr noundef nonnull %13) #8
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %.thread

16:                                               ; preds = %6
  %17 = call ptr @wal_file_allocate(i64 noundef %8)
  call void @wal_file_create(ptr noundef %17)
  %18 = call zeroext i1 @exception_mgr_leave(ptr noundef nonnull %9, ptr noundef nonnull %3)
  br i1 %18, label %20, label %22

.thread:                                          ; preds = %6
  %19 = call zeroext i1 @exception_mgr_leave(ptr noundef nonnull %9, ptr noundef nonnull %3)
  br i1 %19, label %.thread26, label %22

20:                                               ; preds = %16
  %.not22 = icmp eq ptr %17, null
  br i1 %.not22, label %.thread26, label %21

21:                                               ; preds = %20
  call void @wal_file_close(ptr noundef nonnull %17)
  call void @wal_file_free(ptr noundef nonnull %17)
  br label %.thread26

.thread26:                                        ; preds = %.thread, %21, %20
  call void @mutex_unlock(ptr noundef %0)
  call void @exception_mgr_throw(ptr noundef nonnull %9) #9
  unreachable

22:                                               ; preds = %.thread, %16
  %.025 = phi ptr [ null, %.thread ], [ %17, %16 ]
  %23 = getelementptr inbounds i8, ptr %0, i64 72
  %24 = load ptr, ptr %23, align 8, !tbaa !18
  store ptr %.025, ptr %23, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %0, i64 40
  call void @wal_id_add(ptr noundef nonnull %25, i64 noundef %8)
  call void @mutex_unlock(ptr noundef %0)
  %.not = icmp eq ptr %24, null
  br i1 %.not, label %39, label %26

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %9, i64 312
  %28 = load ptr, ptr %27, align 8, !tbaa !24
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !25
  %31 = load ptr, ptr %30, align 8, !tbaa !27
  %32 = getelementptr inbounds i8, ptr %31, i64 1320
  %33 = call i64 @var_int_of(ptr noundef nonnull %32)
  %.not21 = icmp eq i64 %33, 0
  br i1 %.not21, label %38, label %34

34:                                               ; preds = %26
  %35 = call zeroext i1 @config_sync()
  br i1 %35, label %36, label %38

36:                                               ; preds = %34
  %37 = getelementptr inbounds i8, ptr %24, i64 8
  call void @file_sync(ptr noundef nonnull %37)
  br label %38

38:                                               ; preds = %36, %34, %26
  call void @wal_file_close(ptr noundef nonnull %24)
  call void @wal_file_free(ptr noundef nonnull %24)
  br label %39

39:                                               ; preds = %38, %22
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %3) #7
  br label %40

40:                                               ; preds = %39, %5
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @wal_rotate_ready(ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @config_lsn() local_unnamed_addr #1

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

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden zeroext i1 @exception_mgr_leave(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @exception_mgr_throw(ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @wal_id_add(ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @config_sync() local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind returns_twice "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 = { 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 #6 = { inlinehint noreturn 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 #7 = { nounwind }
attributes #8 = { nounwind returns_twice }
attributes #9 = { noreturn }

!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 = !{!"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 0}
!14 = !{!"Exception", !8, i64 0, !15, i64 8, !8, i64 16, !9, i64 24}
!15 = !{!"_Bool", !9, i64 0}
!16 = !{!14, !15, i64 8}
!17 = !{!14, !8, i64 16}
!18 = !{!19, !8, i64 72}
!19 = !{!"Wal", !20, i64 0, !21, i64 40, !8, i64 72}
!20 = !{!"Mutex", !9, i64 0}
!21 = !{!"WalId", !22, i64 0, !12, i64 4, !23, i64 8}
!22 = !{!"Spinlock", !12, i64 0}
!23 = !{!"Buf", !8, i64 0, !8, i64 8, !8, i64 16}
!24 = !{!6, !8, i64 312}
!25 = !{!26, !8, i64 16}
!26 = !{!"Context", !8, i64 0, !8, i64 8, !8, i64 16}
!27 = !{!28, !8, i64 0}
!28 = !{!"Global", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass