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

; 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 }
%struct.anon = 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 }

@globals = external global %struct.libmdbx_globals, align 8
@.str.2 = external hidden unnamed_addr constant [91 x i8], align 1
@__func__.pnl_reserve = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 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: inlinehint nounwind willreturn memory(read) uwtable
declare hidden i64 @pnl_size2bytes(i64 noundef) #1

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

; Function Attrs: nounwind
declare i64 @malloc_usable_size(ptr noundef) #3

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare hidden i32 @pnl_bytes2size(i64 noundef) #1

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

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #5

; Function Attrs: nounwind uwtable
define dso_local i32 @pnl_reserve(ptr noalias noundef %0, i64 noundef %1) #6 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i32, ptr %12, i64 -1
  %14 = load i32, ptr %13, align 4, !tbaa !11
  %15 = zext i32 %14 to i64
  store i64 %15, ptr %6, align 8, !tbaa !9
  br label %16

16:                                               ; preds = %2
  %17 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !13
  %18 = zext i8 %17 to i32
  %19 = and i32 %18, 1
  %20 = icmp ne i32 %19, 0
  %21 = xor i1 %20, true
  %22 = xor i1 %21, true
  %23 = zext i1 %22 to i32
  %24 = sext i32 %23 to i64
  %25 = call i64 @llvm.expect.i64(i64 %24, i64 1)
  %26 = icmp ne i64 %25, 0
  br i1 %26, label %27, label %60

27:                                               ; preds = %16
  br label %28

28:                                               ; preds = %27
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %30, i64 0
  %32 = load i32, ptr %31, align 4, !tbaa !11
  %33 = zext i32 %32 to i64
  %34 = icmp ule i64 %33, 2147483647
  br i1 %34, label %35, label %47

35:                                               ; preds = %28
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds i32, ptr %37, i64 -1
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = zext i32 %39 to i64
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds i32, ptr %42, i64 0
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = zext i32 %44 to i64
  %46 = icmp uge i64 %40, %45
  br label %47

47:                                               ; preds = %35, %28
  %48 = phi i1 [ false, %28 ], [ %46, %35 ]
  %49 = xor i1 %48, true
  %50 = xor i1 %49, true
  %51 = xor i1 %50, true
  %52 = zext i1 %51 to i32
  %53 = sext i32 %52 to i64
  %54 = call i64 @llvm.expect.i64(i64 %53, i64 0)
  %55 = icmp ne i64 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %47
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.2, ptr noundef @__func__.pnl_reserve, i32 noundef 54) #9
  unreachable

57:                                               ; preds = %47
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59, %16
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = load i64, ptr %6, align 8, !tbaa !9
  %64 = load i64, ptr %5, align 8, !tbaa !9
  %65 = icmp uge i64 %63, %64
  %66 = xor i1 %65, true
  %67 = xor i1 %66, true
  %68 = zext i1 %67 to i32
  %69 = sext i32 %68 to i64
  %70 = call i64 @llvm.expect.i64(i64 %69, i64 1)
  %71 = icmp ne i64 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %62
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %172

73:                                               ; preds = %62
  %74 = load i64, ptr %5, align 8, !tbaa !9
  %75 = icmp ugt i64 %74, 2147483647
  %76 = xor i1 %75, true
  %77 = xor i1 %76, true
  %78 = zext i1 %77 to i32
  %79 = sext i32 %78 to i64
  %80 = call i64 @llvm.expect.i64(i64 %79, i64 0)
  %81 = icmp ne i64 %80, 0
  br i1 %81, label %82, label %98

82:                                               ; preds = %73
  br label %83

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

93:                                               ; preds = %83
  %94 = load i64, ptr %5, align 8, !tbaa !9
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 1, ptr noundef @__func__.pnl_reserve, i32 noundef 59, ptr noundef @.str.3, i64 noundef %94, i64 noundef 2147483647)
  br label %95

95:                                               ; preds = %93, %83
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  store i32 -30788, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %172

98:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %99 = load i64, ptr %5, align 8, !tbaa !9
  %100 = load i64, ptr %5, align 8, !tbaa !9
  %101 = add i64 %99, %100
  %102 = load i64, ptr %6, align 8, !tbaa !9
  %103 = sub i64 %101, %102
  %104 = icmp ult i64 %103, 2147483647
  br i1 %104, label %105, label %111

105:                                              ; preds = %98
  %106 = load i64, ptr %5, align 8, !tbaa !9
  %107 = load i64, ptr %5, align 8, !tbaa !9
  %108 = add i64 %106, %107
  %109 = load i64, ptr %6, align 8, !tbaa !9
  %110 = sub i64 %108, %109
  br label %112

111:                                              ; preds = %98
  br label %112

112:                                              ; preds = %111, %105
  %113 = phi i64 [ %110, %105 ], [ 2147483647, %111 ]
  store i64 %113, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %114 = load i64, ptr %8, align 8, !tbaa !9
  %115 = call i64 @pnl_size2bytes(i64 noundef %114) #10
  store i64 %115, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds i32, ptr %117, i64 -1
  %119 = load i64, ptr %9, align 8, !tbaa !9
  %120 = call ptr @realloc(ptr noundef %118, i64 noundef %119) #11
  store ptr %120, ptr %10, align 8, !tbaa !5
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = icmp ne ptr %121, null
  %123 = xor i1 %122, true
  %124 = xor i1 %123, true
  %125 = zext i1 %124 to i32
  %126 = sext i32 %125 to i64
  %127 = call i64 @llvm.expect.i64(i64 %126, i64 1)
  %128 = icmp ne i64 %127, 0
  br i1 %128, label %129, label %170

129:                                              ; preds = %112
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = call i64 @malloc_usable_size(ptr noundef %130) #8
  store i64 %131, ptr %9, align 8, !tbaa !9
  %132 = load i64, ptr %9, align 8, !tbaa !9
  %133 = call i32 @pnl_bytes2size(i64 noundef %132) #10
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %133, ptr %134, align 4, !tbaa !11
  br label %135

135:                                              ; preds = %129
  %136 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !13
  %137 = zext i8 %136 to i32
  %138 = and i32 %137, 1
  %139 = icmp ne i32 %138, 0
  %140 = xor i1 %139, true
  %141 = xor i1 %140, true
  %142 = zext i1 %141 to i32
  %143 = sext i32 %142 to i64
  %144 = call i64 @llvm.expect.i64(i64 %143, i64 1)
  %145 = icmp ne i64 %144, 0
  br i1 %145, label %146, label %164

146:                                              ; preds = %135
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = load i32, ptr %148, align 4, !tbaa !11
  %150 = zext i32 %149 to i64
  %151 = load i64, ptr %5, align 8, !tbaa !9
  %152 = icmp uge i64 %150, %151
  %153 = xor i1 %152, true
  %154 = xor i1 %153, true
  %155 = xor i1 %154, true
  %156 = zext i1 %155 to i32
  %157 = sext i32 %156 to i64
  %158 = call i64 @llvm.expect.i64(i64 %157, i64 0)
  %159 = icmp ne i64 %158, 0
  br i1 %159, label %160, label %161

160:                                              ; preds = %147
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.4, ptr noundef @__func__.pnl_reserve, i32 noundef 71) #9
  unreachable

161:                                              ; preds = %147
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163, %135
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %10, align 8, !tbaa !5
  %168 = getelementptr inbounds i32, ptr %167, i64 1
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %168, ptr %169, align 8, !tbaa !5
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %171

170:                                              ; preds = %112
  store i32 12, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %171

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

172:                                              ; preds = %171, %97, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %173 = load i32, ptr %3, align 4
  ret i32 %173
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint nounwind willreturn memory(read) 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 = { 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 #4 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind allocsize(1) "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 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 = { "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 #8 = { nounwind }
attributes #9 = { noreturn }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind allocsize(1) }

!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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !7, i64 25}
!14 = !{!"libmdbx_globals", !7, i64 0, !12, i64 16, !12, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !15, i64 27, !12, i64 28, !7, i64 32, !7, i64 40, !10, i64 80, !6, i64 88}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!14, !7, i64 26}


; 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 }
%struct.anon = 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 }

@globals = external local_unnamed_addr global %struct.libmdbx_globals, align 8
@.str.2 = external hidden unnamed_addr constant [91 x i8], align 1
@__func__.pnl_reserve = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare hidden i64 @pnl_size2bytes(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare i64 @malloc_usable_size(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare hidden i32 @pnl_bytes2size(i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -30788, 13) i32 @pnl_reserve(ptr noalias nocapture noundef %0, i64 noundef %1) local_unnamed_addr #4 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 -4
  %5 = load i32, ptr %4, align 4, !tbaa !9
  %6 = zext i32 %5 to i64
  %7 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !11
  %8 = and i8 %7, 1
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %14, label %9, !prof !15

9:                                                ; preds = %2
  %10 = load i32, ptr %3, align 4, !tbaa !9
  %11 = icmp slt i32 %10, 0
  %12 = icmp ult i32 %5, %10
  %spec.select = select i1 %11, i1 true, i1 %12
  br i1 %spec.select, label %13, label %14, !prof !15

13:                                               ; preds = %9
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.pnl_reserve, i32 noundef 54) #7
  unreachable

14:                                               ; preds = %9, %2
  %.not30 = icmp ult i64 %6, %1
  br i1 %.not30, label %15, label %34, !prof !15

15:                                               ; preds = %14
  %16 = icmp ugt i64 %1, 2147483647
  br i1 %16, label %17, label %20, !prof !15

17:                                               ; preds = %15
  %18 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !16
  %.not34 = icmp eq i8 %18, 0
  br i1 %.not34, label %34, label %19, !prof !17

19:                                               ; preds = %17
  tail call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 1, ptr noundef nonnull @__func__.pnl_reserve, i32 noundef 59, ptr noundef nonnull @.str.3, i64 noundef %1, i64 noundef 2147483647) #8
  br label %34

20:                                               ; preds = %15
  %21 = shl nuw nsw i64 %1, 1
  %22 = sub nsw i64 %21, %6
  %spec.select35 = tail call i64 @llvm.umin.i64(i64 %22, i64 2147483647)
  %23 = tail call i64 @pnl_size2bytes(i64 noundef %spec.select35) #9
  %24 = tail call ptr @realloc(ptr noundef nonnull %4, i64 noundef %23) #10
  %.not31 = icmp eq ptr %24, null
  br i1 %.not31, label %34, label %25, !prof !15

25:                                               ; preds = %20
  %26 = tail call i64 @malloc_usable_size(ptr noundef nonnull %24) #8
  %27 = tail call i32 @pnl_bytes2size(i64 noundef %26) #9
  store i32 %27, ptr %24, align 4, !tbaa !9
  %28 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !11
  %29 = and i8 %28, 1
  %.not32 = icmp ne i8 %29, 0
  %30 = zext i32 %27 to i64
  %.not33 = icmp ult i64 %30, %1
  %or.cond = select i1 %.not32, i1 %.not33, i1 false
  br i1 %or.cond, label %31, label %32, !prof !18

31:                                               ; preds = %25
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.pnl_reserve, i32 noundef 71) #7
  unreachable

32:                                               ; preds = %25
  %33 = getelementptr inbounds i8, ptr %24, i64 4
  store ptr %33, ptr %0, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %32, %20, %17, %19, %14
  %.1 = phi i32 [ 0, %14 ], [ -30788, %19 ], [ -30788, %17 ], [ 0, %32 ], [ 12, %20 ]
  ret i32 %.1
}

declare void @debug_log(i32 noundef, ptr noundef, i32 noundef, ptr 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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn "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("realloc") allocsize(1) 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 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 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind allocsize(1) }

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 25}
!12 = !{!"libmdbx_globals", !7, i64 0, !10, i64 16, !10, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !13, i64 27, !10, i64 28, !7, i64 32, !7, i64 40, !14, i64 80, !6, i64 88}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!16 = !{!12, !7, i64 26}
!17 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!18 = !{!"branch_weights", i32 2000, i32 4002001}


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