; LLVM IR from erthink/libmdbx :: src (page-ops)

; 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 }
%struct.page_get_result = type { ptr, i32 }
%struct.page = type <{ i64, i16, i16, %union.anon.10, i32, [0 x i16] }>
%union.anon.10 = type { i32 }
%struct.MDBX_txn = type { i32, i32, i64, i64, ptr, ptr, %struct.geo, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, %struct.MDBX_canary, ptr, %union.anon.4 }
%struct.geo = type { i16, i16, i32, i32, %union.anon.2, %union.anon.3 }
%union.anon.2 = type { i32 }
%union.anon.3 = type { i32 }
%struct.MDBX_canary = type { i64, i64, i64, i64 }
%union.anon.4 = type { %struct.anon.6 }
%struct.anon.6 = type { %struct.troika, ptr, %struct.anon.7, i8, i32, i32, i64, ptr, ptr, ptr, i64, %union.anon.8 }
%struct.troika = type { i8, i8, i8, i8, i32, [3 x i64] }
%struct.anon.7 = type { %struct.MDBX_rkl, i64, %struct.MDBX_rkl }
%struct.MDBX_rkl = type { i64, i64, i32, i32, ptr, [12 x i64] }
%union.anon.8 = type { %struct.anon.9 }
%struct.anon.9 = type { i64, 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.13, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i64, %struct.anon.14, %struct.anon.18, i8, ptr, ptr, ptr, %struct.anon.19, %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.12, i32, i64, i64, i64 }
%union.anon.12 = type { ptr }
%union.mdbx_atomic_uint32_t = type { i32 }
%struct.anon.13 = type { ptr, ptr, ptr, ptr }
%struct.anon.14 = type { i32, i32, i32, i32, i64, i8, i8, i8, i8, i32, i32, i8, i8, i8, %struct.anon.15, %union.anon.16 }
%struct.anon.15 = type { i16, i16, i16, i16 }
%union.anon.16 = type { i32 }
%struct.anon.18 = type { i64, i64, i64, i64, i64 }
%struct.anon.19 = type { i64 }
%struct.osal_ioring = type { i32, i32, i32, ptr, ptr, ptr }
%union.mdbx_atomic_uint64_t = type { i64 }
%struct.shared_lck = type { i64, i32, %union.mdbx_atomic_uint32_t, %union.mdbx_atomic_uint32_t, %union.mdbx_atomic_uint32_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, [2 x %union.mdbx_atomic_uint32_t], [16 x i8], %struct.pgops, [16 x i8], %union.pthread_mutex_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint32_t, i32, %struct.anon.22, %union.pthread_mutex_t, %union.mdbx_atomic_uint32_t, %union.mdbx_atomic_uint32_t, [16 x i8], [0 x %struct.reader_slot] }
%struct.pgops = type { %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint32_t, %union.mdbx_atomic_uint32_t, %struct.anon.20 }
%struct.anon.20 = type { %struct.gc_prof_stat, %struct.gc_prof_stat, i32, i32, i32, i32, i32 }
%struct.gc_prof_stat = type { i64, i64, i32, i32, i32, i32, %struct.anon.21 }
%struct.anon.21 = type { i64, i64, i32 }
%struct.anon.22 = type { [4 x i32], [4 x i64] }
%struct.reader_slot = type { %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint64_t, %union.mdbx_atomic_uint32_t, %union.mdbx_atomic_uint32_t, %union.mdbx_atomic_uint64_t }

@globals = external global %struct.libmdbx_globals, align 8
@__func__.page_unspill = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [105 x i8], align 1

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

; Function Attrs: noreturn
declare void @mdbx_assert_fail(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #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.start.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: hot nounwind uwtable
declare dso_local void @page_copy(ptr noundef, ptr noundef, i64 noundef) #4

; Function Attrs: cold nounwind optsize uwtable
define dso_local { ptr, i32 } @page_unspill(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca %struct.page_get_result, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %10

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

20:                                               ; preds = %10
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.page, ptr %21, i32 0, i32 4
  %23 = load i32, ptr %22, align 1, !tbaa !14
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 4, ptr noundef @__func__.page_unspill, i32 noundef 102, ptr noundef @.str.9, i32 noundef %23)
  br label %24

24:                                               ; preds = %20, %10
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  %27 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !15
  %28 = zext i8 %27 to i32
  %29 = and i32 %28, 1
  %30 = icmp ne i32 %29, 0
  %31 = xor i1 %30, true
  %32 = xor i1 %31, true
  %33 = zext i1 %32 to i32
  %34 = sext i32 %33 to i64
  %35 = call i64 @llvm.expect.i64(i64 %34, i64 1)
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %57

37:                                               ; preds = %26
  br label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.MDBX_txn, ptr %39, i32 0, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !16
  %42 = and i32 %41, 524288
  %43 = icmp eq i32 %42, 0
  %44 = xor i1 %43, true
  %45 = xor i1 %44, true
  %46 = xor i1 %45, true
  %47 = zext i1 %46 to i32
  %48 = sext i32 %47 to i64
  %49 = call i64 @llvm.expect.i64(i64 %48, i64 0)
  %50 = icmp ne i64 %49, 0
  br i1 %50, label %51, label %55

51:                                               ; preds = %38
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.MDBX_txn, ptr %52, i32 0, i32 9
  %54 = load ptr, ptr %53, align 8, !tbaa !21
  call void @mdbx_assert_fail(ptr noundef %54, ptr noundef @.str.10, ptr noundef @__func__.page_unspill, i32 noundef 103) #9
  unreachable

55:                                               ; preds = %38
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56, %26
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  %60 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !15
  %61 = zext i8 %60 to i32
  %62 = and i32 %61, 1
  %63 = icmp ne i32 %62, 0
  %64 = xor i1 %63, true
  %65 = xor i1 %64, true
  %66 = zext i1 %65 to i32
  %67 = sext i32 %66 to i64
  %68 = call i64 @llvm.expect.i64(i64 %67, i64 1)
  %69 = icmp ne i64 %68, 0
  br i1 %69, label %70, label %88

70:                                               ; preds = %59
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = call zeroext i1 @is_spilled(ptr noundef %72, ptr noundef %73) #10
  %75 = xor i1 %74, true
  %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 %86

82:                                               ; preds = %71
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.MDBX_txn, ptr %83, i32 0, i32 9
  %85 = load ptr, ptr %84, align 8, !tbaa !21
  call void @mdbx_assert_fail(ptr noundef %85, ptr noundef @.str.11, ptr noundef @__func__.page_unspill, i32 noundef 104) #9
  unreachable

86:                                               ; preds = %71
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87, %59
  br label %89

89:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #11
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %90, ptr %6, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %237, %89
  br label %92

92:                                               ; preds = %91
  %93 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !15
  %94 = zext i8 %93 to i32
  %95 = and i32 %94, 1
  %96 = icmp ne i32 %95, 0
  %97 = xor i1 %96, true
  %98 = xor i1 %97, true
  %99 = zext i1 %98 to i32
  %100 = sext i32 %99 to i64
  %101 = call i64 @llvm.expect.i64(i64 %100, i64 1)
  %102 = icmp ne i64 %101, 0
  br i1 %102, label %103, label %124

103:                                              ; preds = %92
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.MDBX_txn, ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !16
  %108 = and i32 %107, 8
  %109 = icmp ne i32 %108, 0
  %110 = xor i1 %109, true
  %111 = xor i1 %110, true
  %112 = xor i1 %111, true
  %113 = zext i1 %112 to i32
  %114 = sext i32 %113 to i64
  %115 = call i64 @llvm.expect.i64(i64 %114, i64 0)
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %121

117:                                              ; preds = %104
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.MDBX_txn, ptr %118, i32 0, i32 9
  %120 = load ptr, ptr %119, align 8, !tbaa !21
  call void @mdbx_assert_fail(ptr noundef %120, ptr noundef @.str.12, ptr noundef @__func__.page_unspill, i32 noundef 108) #9
  unreachable

121:                                              ; preds = %104
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123, %92
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #11
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.page, ptr %128, i32 0, i32 4
  %130 = load i32, ptr %129, align 1, !tbaa !14
  %131 = call i64 @spill_search(ptr noundef %127, i32 noundef %130)
  store i64 %131, ptr %7, align 8, !tbaa !22
  %132 = load i64, ptr %7, align 8, !tbaa !22
  %133 = icmp ne i64 %132, 0
  br i1 %133, label %135, label %134

134:                                              ; preds = %126
  store i32 13, ptr %8, align 4
  br label %224

135:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #11
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = call zeroext i1 @is_largepage(ptr noundef %136) #10
  br i1 %137, label %138, label %142

138:                                              ; preds = %135
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.page, ptr %139, i32 0, i32 3
  %141 = load i32, ptr %140, align 1, !tbaa !23
  br label %143

142:                                              ; preds = %135
  br label %143

143:                                              ; preds = %142, %138
  %144 = phi i32 [ %141, %138 ], [ 1, %142 ]
  store i32 %144, ptr %9, align 4, !tbaa !14
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load i32, ptr %9, align 4, !tbaa !14
  %147 = zext i32 %146 to i64
  %148 = call ptr @page_shadow_alloc(ptr noundef %145, i64 noundef %147)
  %149 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 0
  store ptr %148, ptr %149, align 8, !tbaa !24
  %150 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8, !tbaa !24
  %152 = icmp ne ptr %151, null
  %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 %162

160:                                              ; preds = %143
  %161 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 1
  store i32 12, ptr %161, align 8, !tbaa !26
  store i32 1, ptr %8, align 4
  br label %223

162:                                              ; preds = %143
  %163 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !24
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.MDBX_txn, ptr %166, i32 0, i32 9
  %168 = load ptr, ptr %167, align 8, !tbaa !21
  %169 = load i32, ptr %9, align 4, !tbaa !14
  %170 = zext i32 %169 to i64
  %171 = call i64 @pgno2bytes(ptr noundef %168, i64 noundef %170) #10
  call void @page_copy(ptr noundef %164, ptr noundef %165, i64 noundef %171) #12
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = icmp eq ptr %172, %173
  br i1 %174, label %175, label %180

175:                                              ; preds = %162
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = load i64, ptr %7, align 8, !tbaa !22
  %178 = load i32, ptr %9, align 4, !tbaa !14
  %179 = zext i32 %178 to i64
  call void @spill_remove(ptr noundef %176, i64 noundef %177, i64 noundef %179)
  br label %180

180:                                              ; preds = %175, %162
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 0
  %183 = load ptr, ptr %182, align 8, !tbaa !24
  %184 = load i32, ptr %9, align 4, !tbaa !14
  %185 = zext i32 %184 to i64
  %186 = call i32 @page_dirty(ptr noundef %181, ptr noundef %183, i64 noundef %185)
  %187 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 1
  store i32 %186, ptr %187, align 8, !tbaa !26
  %188 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 1
  %189 = load i32, ptr %188, align 8, !tbaa !26
  %190 = icmp ne i32 %189, 0
  %191 = xor i1 %190, true
  %192 = xor i1 %191, true
  %193 = zext i1 %192 to i32
  %194 = sext i32 %193 to i64
  %195 = call i64 @llvm.expect.i64(i64 %194, i64 0)
  %196 = icmp ne i64 %195, 0
  br i1 %196, label %197, label %198

197:                                              ; preds = %180
  store i32 1, ptr %8, align 4
  br label %223

198:                                              ; preds = %180
  %199 = load i32, ptr %9, align 4, !tbaa !14
  %200 = zext i32 %199 to i64
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.MDBX_txn, ptr %201, i32 0, i32 9
  %203 = load ptr, ptr %202, align 8, !tbaa !21
  %204 = getelementptr inbounds %struct.MDBX_env, ptr %203, i32 0, i32 7
  %205 = load ptr, ptr %204, align 8, !tbaa !27
  %206 = getelementptr inbounds %struct.shared_lck, ptr %205, i32 0, i32 9
  %207 = getelementptr inbounds %struct.pgops, ptr %206, i32 0, i32 6
  %208 = load volatile i64, ptr %207, align 16, !tbaa !23
  %209 = add i64 %208, %200
  store volatile i64 %209, ptr %207, align 16, !tbaa !23
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = icmp eq ptr %210, %211
  %213 = zext i1 %212 to i64
  %214 = select i1 %212, i32 0, i32 8192
  %215 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !24
  %217 = getelementptr inbounds %struct.page, ptr %216, i32 0, i32 2
  %218 = load i16, ptr %217, align 1, !tbaa !36
  %219 = zext i16 %218 to i32
  %220 = or i32 %219, %214
  %221 = trunc i32 %220 to i16
  store i16 %221, ptr %217, align 1, !tbaa !36
  %222 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 1
  store i32 0, ptr %222, align 8, !tbaa !26
  store i32 1, ptr %8, align 4
  br label %223

223:                                              ; preds = %198, %197, %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #11
  br label %224

224:                                              ; preds = %223, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #11
  %225 = load i32, ptr %8, align 4
  switch i32 %225, label %288 [
    i32 13, label %226
  ]

226:                                              ; preds = %224
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.MDBX_txn, ptr %227, i32 0, i32 4
  %229 = load ptr, ptr %228, align 8, !tbaa !37
  store ptr %229, ptr %6, align 8, !tbaa !5
  %230 = icmp ne ptr %229, null
  br i1 %230, label %231, label %237

231:                                              ; preds = %226
  %232 = load ptr, ptr %6, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.MDBX_txn, ptr %232, i32 0, i32 1
  %234 = load i32, ptr %233, align 4, !tbaa !16
  %235 = and i32 %234, 8
  %236 = icmp ne i32 %235, 0
  br label %237

237:                                              ; preds = %231, %226
  %238 = phi i1 [ false, %226 ], [ %236, %231 ]
  %239 = xor i1 %238, true
  %240 = xor i1 %239, true
  %241 = zext i1 %240 to i32
  %242 = sext i32 %241 to i64
  %243 = call i64 @llvm.expect.i64(i64 %242, i64 1)
  %244 = icmp ne i64 %243, 0
  br i1 %244, label %91, label %245, !llvm.loop !38

245:                                              ; preds = %237
  br label %246

246:                                              ; preds = %245
  %247 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 5), align 2, !tbaa !9
  %248 = zext i8 %247 to i32
  %249 = icmp sle i32 1, %248
  %250 = xor i1 %249, true
  %251 = xor i1 %250, true
  %252 = zext i1 %251 to i32
  %253 = sext i32 %252 to i64
  %254 = call i64 @llvm.expect.i64(i64 %253, i64 0)
  %255 = icmp ne i64 %254, 0
  br i1 %255, label %256, label %283

256:                                              ; preds = %246
  %257 = load ptr, ptr %5, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.page, ptr %257, i32 0, i32 4
  %259 = load i32, ptr %258, align 1, !tbaa !14
  %260 = load ptr, ptr %5, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.page, ptr %260, i32 0, i32 0
  %262 = load i64, ptr %261, align 1, !tbaa !22
  %263 = load ptr, ptr %4, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.MDBX_txn, ptr %263, i32 0, i32 7
  %265 = load i64, ptr %264, align 8, !tbaa !40
  %266 = load ptr, ptr %4, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.MDBX_txn, ptr %266, i32 0, i32 8
  %268 = load i64, ptr %267, align 8, !tbaa !41
  %269 = load ptr, ptr %4, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.MDBX_txn, ptr %269, i32 0, i32 9
  %271 = load ptr, ptr %270, align 8, !tbaa !21
  %272 = getelementptr inbounds %struct.MDBX_env, ptr %271, i32 0, i32 24
  %273 = load ptr, ptr %272, align 8, !tbaa !42
  %274 = getelementptr inbounds %struct.MDBX_txn, ptr %273, i32 0, i32 7
  %275 = load i64, ptr %274, align 8, !tbaa !40
  %276 = load ptr, ptr %4, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.MDBX_txn, ptr %276, i32 0, i32 9
  %278 = load ptr, ptr %277, align 8, !tbaa !21
  %279 = getelementptr inbounds %struct.MDBX_env, ptr %278, i32 0, i32 24
  %280 = load ptr, ptr %279, align 8, !tbaa !42
  %281 = getelementptr inbounds %struct.MDBX_txn, ptr %280, i32 0, i32 8
  %282 = load i64, ptr %281, align 8, !tbaa !41
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 1, ptr noundef @__func__.page_unspill, i32 noundef 140, ptr noundef @.str.13, i32 noundef %259, i64 noundef %262, i64 noundef %265, i64 noundef %268, i64 noundef %275, i64 noundef %282)
  br label %283

283:                                              ; preds = %256, %246
  br label %284

284:                                              ; preds = %283
  br label %285

285:                                              ; preds = %284
  %286 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 1
  store i32 -30779, ptr %286, align 8, !tbaa !26
  %287 = getelementptr inbounds %struct.page_get_result, ptr %3, i32 0, i32 0
  store ptr null, ptr %287, align 8, !tbaa !24
  store i32 1, ptr %8, align 4
  br label %288

288:                                              ; preds = %285, %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #11
  %289 = load { ptr, i32 }, ptr %3, align 8
  ret { ptr, i32 } %289
}

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare hidden zeroext i1 @is_spilled(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @spill_search(ptr noundef, i32 noundef) #7

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare hidden zeroext i1 @is_largepage(ptr noundef) #6

; Function Attrs: nounwind uwtable
declare dso_local ptr @page_shadow_alloc(ptr noundef, i64 noundef) #8

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare hidden i64 @pgno2bytes(ptr noundef, i64 noundef) #6

declare void @spill_remove(ptr noundef, i64 noundef, i64 noundef) #2

; Function Attrs: hot nounwind uwtable
declare dso_local i32 @page_dirty(ptr noundef, ptr noundef, i64 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #1 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #7 = { 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 #8 = { 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 #9 = { noreturn }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind }
attributes #12 = { hot }

!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 = !{!11, !11, i64 0}
!15 = !{!10, !7, i64 25}
!16 = !{!17, !11, i64 4}
!17 = !{!"MDBX_txn", !11, i64 0, !11, i64 4, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !18, i64 40, !13, i64 64, !13, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !20, i64 128, !6, i64 160, !7, i64 168}
!18 = !{!"geo", !19, i64 0, !19, i64 2, !11, i64 4, !11, i64 8, !7, i64 12, !7, i64 16}
!19 = !{!"short", !7, i64 0}
!20 = !{!"MDBX_canary", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!21 = !{!17, !6, i64 80}
!22 = !{!13, !13, i64 0}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !6, i64 0}
!25 = !{!"page_get_result", !6, i64 0, !11, i64 8}
!26 = !{!25, !11, i64 8}
!27 = !{!28, !6, i64 104}
!28 = !{!"MDBX_env", !7, i64 0, !11, i64 4, !11, i64 8, !29, i64 16, !11, i64 56, !11, i64 60, !29, i64 64, !6, i64 104, !19, i64 112, !19, i64 114, !19, i64 116, !19, i64 118, !19, i64 120, !19, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !19, i64 130, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !30, 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, !31, i64 264, !33, i64 320, !12, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !34, i64 392, !7, i64 400, !11, i64 440, !11, i64 444, !6, i64 448, !35, i64 456, !7, i64 496, !7, i64 536}
!29 = !{!"osal_mmap", !7, i64 0, !11, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!30 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!31 = !{!"", !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, !32, i64 40, !7, i64 48}
!32 = !{!"", !19, i64 0, !19, i64 2, !19, i64 4, !19, i64 6}
!33 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!34 = !{!"", !13, i64 0}
!35 = !{!"osal_ioring", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!36 = !{!19, !19, i64 0}
!37 = !{!17, !6, i64 24}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = !{!17, !13, i64 64}
!41 = !{!17, !13, i64 72}
!42 = !{!28, !6, i64 192}


; 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
@__func__.page_unspill = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [105 x i8], align 1

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

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

; Function Attrs: hot nounwind uwtable
declare dso_local void @page_copy(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load i32, ptr %6, align 1, !tbaa !14
  tail call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 4, ptr noundef nonnull @__func__.page_unspill, i32 noundef 102, ptr noundef nonnull @.str.9, i32 noundef %7) #7
  br label %8

8:                                                ; preds = %5, %2
  %9 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !15
  %10 = and i8 %9, 1
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %.thread, label %11, !prof !13

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 4
  %13 = load i32, ptr %12, align 4, !tbaa !16
  %14 = and i32 %13, 524288
  %.not46 = icmp eq i32 %14, 0
  br i1 %.not46, label %18, label %15, !prof !21

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = load ptr, ptr %16, align 8, !tbaa !22
  tail call void @mdbx_assert_fail(ptr noundef %17, ptr noundef nonnull @.str.10, ptr noundef nonnull @__func__.page_unspill, i32 noundef 103) #8
  unreachable

18:                                               ; preds = %11
  %19 = tail call zeroext i1 @is_spilled(ptr noundef nonnull %0, ptr noundef %1) #9
  br i1 %19, label %.thread, label %20, !prof !21

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %0, i64 80
  %22 = load ptr, ptr %21, align 8, !tbaa !22
  tail call void @mdbx_assert_fail(ptr noundef %22, ptr noundef nonnull @.str.11, ptr noundef nonnull @__func__.page_unspill, i32 noundef 104) #8
  unreachable

.thread:                                          ; preds = %8, %18
  %23 = getelementptr inbounds i8, ptr %1, i64 16
  br label %24

24:                                               ; preds = %68, %.thread
  %.042 = phi ptr [ %0, %.thread ], [ %67, %68 ]
  %25 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !15
  %26 = and i8 %25, 1
  %.not48 = icmp eq i8 %26, 0
  br i1 %.not48, label %34, label %27, !prof !13

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %.042, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !16
  %30 = and i32 %29, 8
  %.not49 = icmp eq i32 %30, 0
  br i1 %.not49, label %31, label %34, !prof !13

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %0, i64 80
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  tail call void @mdbx_assert_fail(ptr noundef %33, ptr noundef nonnull @.str.12, ptr noundef nonnull @__func__.page_unspill, i32 noundef 108) #8
  unreachable

34:                                               ; preds = %27, %24
  %35 = load i32, ptr %23, align 1, !tbaa !14
  %36 = tail call i64 @spill_search(ptr noundef %.042, i32 noundef %35)
  %.not50 = icmp eq i64 %36, 0
  br i1 %.not50, label %65, label %37

37:                                               ; preds = %34
  %38 = tail call zeroext i1 @is_largepage(ptr noundef nonnull %1) #9
  br i1 %38, label %39, label %43

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %1, i64 12
  %41 = load i32, ptr %40, align 1, !tbaa !23
  %42 = zext i32 %41 to i64
  br label %43

43:                                               ; preds = %37, %39
  %44 = phi i64 [ %42, %39 ], [ 1, %37 ]
  %45 = tail call ptr @page_shadow_alloc(ptr noundef %0, i64 noundef %44)
  %.not51 = icmp eq ptr %45, null
  br i1 %.not51, label %.thread55, label %46, !prof !13

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %0, i64 80
  %48 = load ptr, ptr %47, align 8, !tbaa !22
  %49 = tail call i64 @pgno2bytes(ptr noundef %48, i64 noundef %44) #9
  tail call void @page_copy(ptr noundef nonnull %45, ptr noundef nonnull %1, i64 noundef %49) #10
  %50 = icmp eq ptr %.042, %0
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  tail call void @spill_remove(ptr noundef nonnull %0, i64 noundef %36, i64 noundef %44) #7
  br label %52

52:                                               ; preds = %51, %46
  %53 = tail call i32 @page_dirty(ptr noundef nonnull %0, ptr noundef nonnull %45, i64 noundef %44)
  %.not52 = icmp eq i32 %53, 0
  br i1 %.not52, label %54, label %.thread55, !prof !21

54:                                               ; preds = %52
  %55 = load ptr, ptr %47, align 8, !tbaa !22
  %56 = getelementptr inbounds i8, ptr %55, i64 104
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  %58 = getelementptr inbounds i8, ptr %57, i64 112
  %59 = load volatile i64, ptr %58, align 16, !tbaa !23
  %60 = add i64 %59, %44
  store volatile i64 %60, ptr %58, align 16, !tbaa !23
  %61 = select i1 %50, i16 0, i16 8192
  %62 = getelementptr inbounds i8, ptr %45, i64 10
  %63 = load i16, ptr %62, align 1, !tbaa !33
  %64 = or i16 %63, %61
  store i16 %64, ptr %62, align 1, !tbaa !33
  br label %.thread55

65:                                               ; preds = %34
  %66 = getelementptr inbounds i8, ptr %.042, i64 24
  %67 = load ptr, ptr %66, align 8, !tbaa !34
  %.not53 = icmp eq ptr %67, null
  br i1 %.not53, label %.critedge, label %68, !prof !13

68:                                               ; preds = %65
  %69 = getelementptr inbounds i8, ptr %67, i64 4
  %70 = load i32, ptr %69, align 4, !tbaa !16
  %71 = and i32 %70, 8
  %.not58 = icmp eq i32 %71, 0
  br i1 %.not58, label %.critedge, label %24, !prof !13, !llvm.loop !35

.critedge:                                        ; preds = %65, %68
  %72 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !5
  %.not54 = icmp eq i8 %72, 0
  br i1 %.not54, label %.thread55, label %73, !prof !21

73:                                               ; preds = %.critedge
  %74 = load i32, ptr %23, align 1, !tbaa !14
  %75 = load i64, ptr %1, align 1, !tbaa !37
  %76 = getelementptr inbounds i8, ptr %0, i64 64
  %77 = load i64, ptr %76, align 8, !tbaa !38
  %78 = getelementptr inbounds i8, ptr %0, i64 72
  %79 = load i64, ptr %78, align 8, !tbaa !39
  %80 = getelementptr inbounds i8, ptr %0, i64 80
  %81 = load ptr, ptr %80, align 8, !tbaa !22
  %82 = getelementptr inbounds i8, ptr %81, i64 192
  %83 = load ptr, ptr %82, align 8, !tbaa !40
  %84 = getelementptr inbounds i8, ptr %83, i64 64
  %85 = load i64, ptr %84, align 8, !tbaa !38
  %86 = getelementptr inbounds i8, ptr %83, i64 72
  %87 = load i64, ptr %86, align 8, !tbaa !39
  tail call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 1, ptr noundef nonnull @__func__.page_unspill, i32 noundef 140, ptr noundef nonnull @.str.13, i32 noundef %74, i64 noundef %75, i64 noundef %77, i64 noundef %79, i64 noundef %85, i64 noundef %87) #7
  br label %.thread55

.thread55:                                        ; preds = %52, %43, %54, %.critedge, %73
  %.sroa.0.2 = phi ptr [ null, %73 ], [ null, %.critedge ], [ %45, %54 ], [ null, %43 ], [ %45, %52 ]
  %.sroa.7.3 = phi i32 [ -30779, %73 ], [ -30779, %.critedge ], [ 0, %54 ], [ 12, %43 ], [ %53, %52 ]
  %.fca.0.insert = insertvalue { ptr, i32 } poison, ptr %.sroa.0.2, 0
  %.fca.1.insert = insertvalue { ptr, i32 } %.fca.0.insert, i32 %.sroa.7.3, 1
  ret { ptr, i32 } %.fca.1.insert
}

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare hidden zeroext i1 @is_spilled(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @spill_search(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare hidden zeroext i1 @is_largepage(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local ptr @page_shadow_alloc(ptr noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare hidden i64 @pgno2bytes(ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @spill_remove(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: hot nounwind uwtable
declare dso_local i32 @page_dirty(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 #2 = { 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 #3 = { 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 #4 = { 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 #5 = { 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 #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 = { nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { hot }

!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 = !{!9, !9, i64 0}
!15 = !{!6, !7, i64 25}
!16 = !{!17, !9, i64 4}
!17 = !{!"MDBX_txn", !9, i64 0, !9, i64 4, !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 32, !18, i64 40, !11, i64 64, !11, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !20, i64 128, !12, i64 160, !7, i64 168}
!18 = !{!"geo", !19, i64 0, !19, i64 2, !9, i64 4, !9, i64 8, !7, i64 12, !7, i64 16}
!19 = !{!"short", !7, i64 0}
!20 = !{!"MDBX_canary", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!21 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!22 = !{!17, !12, i64 80}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !12, i64 104}
!25 = !{!"MDBX_env", !7, i64 0, !9, i64 4, !9, i64 8, !26, i64 16, !9, i64 56, !9, i64 60, !26, i64 64, !12, i64 104, !19, i64 112, !19, i64 114, !19, i64 116, !19, i64 118, !19, i64 120, !19, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !19, i64 130, !9, i64 132, !9, i64 136, !9, i64 140, !9, i64 144, !27, 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, !28, i64 264, !30, i64 320, !10, i64 360, !12, i64 368, !12, i64 376, !12, i64 384, !31, i64 392, !7, i64 400, !9, i64 440, !9, i64 444, !12, i64 448, !32, i64 456, !7, i64 496, !7, i64 536}
!26 = !{!"osal_mmap", !7, i64 0, !9, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!27 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!28 = !{!"", !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, !29, i64 40, !7, i64 48}
!29 = !{!"", !19, i64 0, !19, i64 2, !19, i64 4, !19, i64 6}
!30 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!31 = !{!"", !11, i64 0}
!32 = !{!"osal_ioring", !9, i64 0, !9, i64 4, !9, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!33 = !{!19, !19, i64 0}
!34 = !{!17, !12, i64 24}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!11, !11, i64 0}
!38 = !{!17, !11, i64 64}
!39 = !{!17, !11, i64 72}
!40 = !{!25, !12, i64 192}


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