; LLVM IR from erthink/libmdbx :: src (tls)

; 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.libmdbx_globals = type { %union.bin128, i32, i32, i8, i8, i8, i8, i32, %union.logger_union, %union.pthread_mutex_t, i64, ptr }
%union.bin128 = type { %struct.anon.9 }
%struct.anon.9 = type { i64, i64 }
%union.logger_union = type { ptr }
%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.rthc_entry = type { ptr }
%struct.MDBX_env = type { %union.mdbx_atomic_uint32_t, i32, i32, %struct.osal_mmap, i32, i32, %struct.osal_mmap, ptr, i16, i16, i16, i16, i16, i16, %union.mdbx_atomic_uint32_t, i8, i8, i16, i32, i32, i32, i32, %struct.anon, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i64, %struct.anon.0, %struct.anon.4, i8, ptr, ptr, ptr, %struct.anon.5, %union.pthread_mutex_t, i32, i32, ptr, %struct.osal_ioring, %union.pthread_mutex_t, [71 x %union.mdbx_atomic_uint64_t] }
%struct.osal_mmap = type { %union.anon, i32, i64, i64, i64 }
%union.anon = type { ptr }
%union.mdbx_atomic_uint32_t = type { i32 }
%struct.anon = type { ptr, ptr, ptr, ptr }
%struct.anon.0 = type { i32, i32, i32, i32, i64, i8, i8, i8, i8, i32, i32, i8, i8, i8, %struct.anon.1, %union.anon.2 }
%struct.anon.1 = type { i16, i16, i16, i16 }
%union.anon.2 = type { i32 }
%struct.anon.4 = type { i64, i64, i64, i64, i64 }
%struct.anon.5 = type { i64 }
%struct.osal_ioring = type { i32, i32, i32, ptr, ptr, ptr }
%union.mdbx_atomic_uint64_t = type { i64 }

@rthc_count = external hidden global i32, align 4
@rthc_table = external hidden global ptr, align 8
@globals = external global %struct.libmdbx_globals, align 8
@rthc_limit = external hidden global i32, align 4
@rthc_table_static = external hidden global [1 x %struct.rthc_entry], align 8
@__func__.rthc_remove = external hidden unnamed_addr constant [12 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [47 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(none)
declare i64 @llvm.expect.i64(i64, i64) #1

declare void @debug_log(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #2

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

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

; 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) #4

; Function Attrs: cold nounwind optsize uwtable
define dso_local i32 @rthc_remove(ptr noundef %0) #5 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  br label %7

7:                                                ; preds = %1
  %8 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 5), align 2, !tbaa !9
  %9 = zext i8 %8 to i32
  %10 = icmp sle i32 6, %9
  %11 = xor i1 %10, true
  %12 = xor i1 %11, true
  %13 = zext i1 %12 to i32
  %14 = sext i32 %13 to i64
  %15 = call i64 @llvm.expect.i64(i64 %14, i64 0)
  %16 = icmp ne i64 %15, 0
  br i1 %16, label %17, label %26

17:                                               ; preds = %7
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = call ptr @__Wpedantic_format_voidptr(ptr noundef %18)
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.MDBX_env, ptr %20, i32 0, i32 21
  %22 = load i32, ptr %21, align 8, !tbaa !14
  %23 = zext i32 %22 to i64
  %24 = load i32, ptr @rthc_count, align 4, !tbaa !24
  %25 = load i32, ptr @rthc_limit, align 4, !tbaa !24
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 6, ptr noundef @__func__.rthc_remove, i32 noundef 404, ptr noundef @.str.28, ptr noundef %19, i64 noundef %23, i32 noundef %24, i32 noundef %25)
  br label %26

26:                                               ; preds = %17, %7
  br label %27

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !24
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.MDBX_env, ptr %28, i32 0, i32 20
  %30 = load i32, ptr %29, align 4, !tbaa !25
  %31 = icmp ne i32 %30, 0
  %32 = xor i1 %31, true
  %33 = xor i1 %32, true
  %34 = zext i1 %33 to i32
  %35 = sext i32 %34 to i64
  %36 = call i64 @llvm.expect.i64(i64 %35, i64 1)
  %37 = icmp ne i64 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %27
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = call i32 @rthc_drown(ptr noundef %39) #8
  store i32 %40, ptr %3, align 4, !tbaa !24
  br label %41

41:                                               ; preds = %38, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !26
  br label %42

42:                                               ; preds = %77, %41
  %43 = load i64, ptr %4, align 8, !tbaa !26
  %44 = load i32, ptr @rthc_count, align 4, !tbaa !24
  %45 = zext i32 %44 to i64
  %46 = icmp ult i64 %43, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  store i32 4, ptr %5, align 4
  br label %80

48:                                               ; preds = %42
  %49 = load ptr, ptr @rthc_table, align 8, !tbaa !5
  %50 = load i64, ptr %4, align 8, !tbaa !26
  %51 = getelementptr inbounds %struct.rthc_entry, ptr %49, i64 %50
  %52 = getelementptr inbounds %struct.rthc_entry, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !27
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = icmp eq ptr %53, %54
  br i1 %55, label %56, label %76

56:                                               ; preds = %48
  %57 = load i32, ptr @rthc_count, align 4, !tbaa !24
  %58 = add i32 %57, -1
  store i32 %58, ptr @rthc_count, align 4, !tbaa !24
  %59 = icmp ugt i32 %58, 0
  br i1 %59, label %60, label %68

60:                                               ; preds = %56
  %61 = load ptr, ptr @rthc_table, align 8, !tbaa !5
  %62 = load i64, ptr %4, align 8, !tbaa !26
  %63 = getelementptr inbounds %struct.rthc_entry, ptr %61, i64 %62
  %64 = load ptr, ptr @rthc_table, align 8, !tbaa !5
  %65 = load i32, ptr @rthc_count, align 4, !tbaa !24
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds %struct.rthc_entry, ptr %64, i64 %66
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %63, ptr align 8 %67, i64 8, i1 false), !tbaa.struct !29
  br label %75

68:                                               ; preds = %56
  %69 = load ptr, ptr @rthc_table, align 8, !tbaa !5
  %70 = icmp ne ptr %69, @rthc_table_static
  br i1 %70, label %71, label %74

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %72 = load ptr, ptr @rthc_table, align 8, !tbaa !5
  store ptr %72, ptr %6, align 8, !tbaa !5
  store ptr @rthc_table_static, ptr @rthc_table, align 8, !tbaa !5
  store i32 1, ptr @rthc_limit, align 4, !tbaa !24
  call void @osal_memory_barrier()
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %73) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %74

74:                                               ; preds = %71, %68
  br label %75

75:                                               ; preds = %74, %60
  store i32 4, ptr %5, align 4
  br label %80

76:                                               ; preds = %48
  br label %77

77:                                               ; preds = %76
  %78 = load i64, ptr %4, align 8, !tbaa !26
  %79 = add i64 %78, 1
  store i64 %79, ptr %4, align 8, !tbaa !26
  br label %42, !llvm.loop !30

80:                                               ; preds = %75, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 5), align 2, !tbaa !9
  %84 = zext i8 %83 to i32
  %85 = icmp sle i32 6, %84
  %86 = xor i1 %85, true
  %87 = xor i1 %86, true
  %88 = zext i1 %87 to i32
  %89 = sext i32 %88 to i64
  %90 = call i64 @llvm.expect.i64(i64 %89, i64 0)
  %91 = icmp ne i64 %90, 0
  br i1 %91, label %92, label %101

92:                                               ; preds = %82
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = call ptr @__Wpedantic_format_voidptr(ptr noundef %93)
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.MDBX_env, ptr %95, i32 0, i32 21
  %97 = load i32, ptr %96, align 8, !tbaa !14
  %98 = zext i32 %97 to i64
  %99 = load i32, ptr @rthc_count, align 4, !tbaa !24
  %100 = load i32, ptr @rthc_limit, align 4, !tbaa !24
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 6, ptr noundef @__func__.rthc_remove, i32 noundef 426, ptr noundef @.str.29, ptr noundef %94, i64 noundef %98, i32 noundef %99, i32 noundef %100)
  br label %101

101:                                              ; preds = %92, %82
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %3, align 4, !tbaa !24
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  ret i32 %104
}

; Function Attrs: cold nounwind optsize uwtable
declare hidden i32 @rthc_drown(ptr noundef) #5

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { cold nounwind optsize 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 = { 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 #7 = { nounwind }
attributes #8 = { cold }

!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, !7, i64 26}
!10 = !{!"libmdbx_globals", !7, i64 0, !11, i64 16, !11, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !12, i64 27, !11, i64 28, !7, i64 32, !7, i64 40, !13, i64 80, !6, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !11, i64 144}
!15 = !{!"MDBX_env", !7, i64 0, !11, i64 4, !11, i64 8, !16, i64 16, !11, i64 56, !11, i64 60, !16, i64 64, !6, i64 104, !17, i64 112, !17, i64 114, !17, i64 116, !17, i64 118, !17, i64 120, !17, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !17, i64 130, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !18, i64 152, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !11, i64 224, !11, i64 228, !11, i64 232, !6, i64 240, !6, i64 248, !13, i64 256, !19, i64 264, !21, i64 320, !12, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !22, i64 392, !7, i64 400, !11, i64 440, !11, i64 444, !6, i64 448, !23, i64 456, !7, i64 496, !7, i64 536}
!16 = !{!"osal_mmap", !7, i64 0, !11, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!17 = !{!"short", !7, i64 0}
!18 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!19 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !13, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !11, i64 28, !11, i64 32, !12, i64 36, !12, i64 37, !12, i64 38, !20, i64 40, !7, i64 48}
!20 = !{!"", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6}
!21 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!22 = !{!"", !13, i64 0}
!23 = !{!"osal_ioring", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!24 = !{!11, !11, i64 0}
!25 = !{!15, !11, i64 140}
!26 = !{!13, !13, i64 0}
!27 = !{!28, !6, i64 0}
!28 = !{!"rthc_entry", !6, i64 0}
!29 = !{i64 0, i64 8, !5}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; 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.libmdbx_globals = type { %union.bin128, i32, i32, i8, i8, i8, i8, i32, %union.logger_union, %union.pthread_mutex_t, i64, ptr }
%union.bin128 = type { %struct.anon.9 }
%struct.anon.9 = type { i64, i64 }
%union.logger_union = type { ptr }
%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.rthc_entry = type { ptr }

@rthc_count = external hidden local_unnamed_addr global i32, align 4
@rthc_table = external hidden local_unnamed_addr global ptr, align 8
@globals = external local_unnamed_addr global %struct.libmdbx_globals, align 8
@rthc_limit = external hidden local_unnamed_addr global i32, align 4
@rthc_table_static = external hidden global [1 x %struct.rthc_entry], align 8
@__func__.rthc_remove = external hidden unnamed_addr constant [12 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [47 x i8], align 1

declare void @debug_log(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

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

; Function Attrs: cold nounwind optsize uwtable
define dso_local i32 @rthc_remove(ptr noundef %0) local_unnamed_addr #2 {
  %2 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !5
  %3 = icmp ugt i8 %2, 5
  br i1 %3, label %4, label %11, !prof !13

4:                                                ; preds = %1
  %5 = tail call ptr @__Wpedantic_format_voidptr(ptr noundef %0)
  %6 = getelementptr inbounds i8, ptr %0, i64 144
  %7 = load i32, ptr %6, align 8, !tbaa !14
  %8 = zext i32 %7 to i64
  %9 = load i32, ptr @rthc_count, align 4, !tbaa !24
  %10 = load i32, ptr @rthc_limit, align 4, !tbaa !24
  tail call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 6, ptr noundef nonnull @__func__.rthc_remove, i32 noundef 404, ptr noundef nonnull @.str.28, ptr noundef %5, i64 noundef %8, i32 noundef %9, i32 noundef %10) #4
  br label %11

11:                                               ; preds = %1, %4
  %12 = getelementptr inbounds i8, ptr %0, i64 140
  %13 = load i32, ptr %12, align 4, !tbaa !25
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %16, label %14, !prof !13

14:                                               ; preds = %11
  %15 = tail call i32 @rthc_drown(ptr noundef nonnull %0) #5
  br label %16

16:                                               ; preds = %14, %11
  %.0 = phi i32 [ %15, %14 ], [ 0, %11 ]
  %17 = load i32, ptr @rthc_count, align 4, !tbaa !24
  %18 = zext i32 %17 to i64
  %.not21 = icmp eq i32 %17, 0
  br i1 %.not21, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %16
  %19 = load ptr, ptr @rthc_table, align 8, !tbaa !26
  br label %20

20:                                               ; preds = %.lr.ph, %33
  %.01220 = phi i64 [ 0, %.lr.ph ], [ %34, %33 ]
  %21 = getelementptr inbounds %struct.rthc_entry, ptr %19, i64 %.01220
  %22 = load ptr, ptr %21, align 8, !tbaa !27
  %23 = icmp eq ptr %22, %0
  br i1 %23, label %24, label %33

24:                                               ; preds = %20
  %25 = add i32 %17, -1
  store i32 %25, ptr @rthc_count, align 4, !tbaa !24
  %.not15 = icmp eq i32 %25, 0
  br i1 %.not15, label %31, label %26

26:                                               ; preds = %24
  %27 = getelementptr inbounds %struct.rthc_entry, ptr %19, i64 %.01220
  %28 = zext i32 %25 to i64
  %29 = getelementptr inbounds %struct.rthc_entry, ptr %19, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !26
  store i64 %30, ptr %27, align 8, !tbaa !26
  br label %.loopexit

31:                                               ; preds = %24
  %.not16 = icmp eq ptr %19, @rthc_table_static
  br i1 %.not16, label %.loopexit, label %32

32:                                               ; preds = %31
  store ptr @rthc_table_static, ptr @rthc_table, align 8, !tbaa !26
  store i32 1, ptr @rthc_limit, align 4, !tbaa !24
  tail call void @osal_memory_barrier()
  tail call void @free(ptr noundef %19) #4
  br label %.loopexit

33:                                               ; preds = %20
  %34 = add nuw nsw i64 %.01220, 1
  %exitcond.not = icmp eq i64 %34, %18
  br i1 %exitcond.not, label %.loopexit, label %20, !llvm.loop !29

.loopexit:                                        ; preds = %33, %16, %26, %32, %31
  %35 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !5
  %36 = icmp ugt i8 %35, 5
  br i1 %36, label %37, label %44, !prof !13

37:                                               ; preds = %.loopexit
  %38 = tail call ptr @__Wpedantic_format_voidptr(ptr noundef %0)
  %39 = getelementptr inbounds i8, ptr %0, i64 144
  %40 = load i32, ptr %39, align 8, !tbaa !14
  %41 = zext i32 %40 to i64
  %42 = load i32, ptr @rthc_count, align 4, !tbaa !24
  %43 = load i32, ptr @rthc_limit, align 4, !tbaa !24
  tail call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 6, ptr noundef nonnull @__func__.rthc_remove, i32 noundef 426, ptr noundef nonnull @.str.29, ptr noundef %38, i64 noundef %41, i32 noundef %42, i32 noundef %43) #4
  br label %44

44:                                               ; preds = %37, %.loopexit
  ret i32 %.0
}

; Function Attrs: cold nounwind optsize uwtable
declare hidden i32 @rthc_drown(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

attributes #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 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 = { cold nounwind optsize 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nounwind }
attributes #5 = { cold }

!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, !7, i64 26}
!6 = !{!"libmdbx_globals", !7, i64 0, !9, i64 16, !9, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !10, i64 27, !9, i64 28, !7, i64 32, !7, i64 40, !11, i64 80, !12, i64 88}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!14 = !{!15, !9, i64 144}
!15 = !{!"MDBX_env", !7, i64 0, !9, i64 4, !9, i64 8, !16, i64 16, !9, i64 56, !9, i64 60, !16, i64 64, !12, i64 104, !17, i64 112, !17, i64 114, !17, i64 116, !17, i64 118, !17, i64 120, !17, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !17, i64 130, !9, i64 132, !9, i64 136, !9, i64 140, !9, i64 144, !18, i64 152, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !9, i64 224, !9, i64 228, !9, i64 232, !12, i64 240, !12, i64 248, !11, i64 256, !19, i64 264, !21, i64 320, !10, i64 360, !12, i64 368, !12, i64 376, !12, i64 384, !22, i64 392, !7, i64 400, !9, i64 440, !9, i64 444, !12, i64 448, !23, i64 456, !7, i64 496, !7, i64 536}
!16 = !{!"osal_mmap", !7, i64 0, !9, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!17 = !{!"short", !7, i64 0}
!18 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!19 = !{!"", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !11, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !9, i64 28, !9, i64 32, !10, i64 36, !10, i64 37, !10, i64 38, !20, i64 40, !7, i64 48}
!20 = !{!"", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6}
!21 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!22 = !{!"", !11, i64 0}
!23 = !{!"osal_ioring", !9, i64 0, !9, i64 4, !9, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!24 = !{!9, !9, i64 0}
!25 = !{!15, !9, i64 140}
!26 = !{!12, !12, i64 0}
!27 = !{!28, !12, i64 0}
!28 = !{!"rthc_entry", !12, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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