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

; 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.5 }
%struct.anon.5 = 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.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.8, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i64, %struct.anon.9, %struct.anon.13, i8, ptr, ptr, ptr, %struct.anon.14, %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.7, i32, i64, i64, i64 }
%union.anon.7 = type { ptr }
%union.mdbx_atomic_uint32_t = type { i32 }
%struct.anon.8 = type { ptr, ptr, ptr, ptr }
%struct.anon.9 = type { i32, i32, i32, i32, i64, i8, i8, i8, i8, i32, i32, i8, i8, i8, %struct.anon.10, %union.anon.11 }
%struct.anon.10 = type { i16, i16, i16, i16 }
%union.anon.11 = type { i32 }
%struct.anon.13 = type { i64, i64, i64, i64, i64 }
%struct.anon.14 = 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.17, %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.15 }
%struct.anon.15 = 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.16 }
%struct.anon.16 = type { i64, i64, i32 }
%struct.anon.17 = 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
@.str.30 = external hidden unnamed_addr constant [37 x i8], align 1
@__func__.dxb_set_readahead = external hidden unnamed_addr constant [18 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [4 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 willreturn memory(read) uwtable
declare hidden i32 @bytes2pgno(ptr noundef, i64 noundef) #3

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @pgno_align2os_bytes(ptr noundef, i64 noundef) #5

declare void @mincore_clean_cache(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @madvise(ptr noundef, i64 noundef, i32 noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ignore_enosys(i32 noundef) #7

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #8

; Function Attrs: cold nounwind optsize uwtable
define dso_local i32 @dxb_set_readahead(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3) #9 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %8, align 1, !tbaa !11
  %19 = zext i1 %3 to i8
  store i8 %19, ptr %9, align 1, !tbaa !11
  br label %20

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

31:                                               ; preds = %20
  br label %32

32:                                               ; preds = %31
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = icmp uge i32 %33, 3
  br i1 %34, label %35, label %38

35:                                               ; preds = %32
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = icmp ule i32 %36, -2147483648
  br label %38

38:                                               ; preds = %35, %32
  %39 = phi i1 [ false, %32 ], [ %37, %35 ]
  %40 = xor i1 %39, true
  %41 = xor i1 %40, true
  %42 = xor i1 %41, true
  %43 = zext i1 %42 to i32
  %44 = sext i32 %43 to i64
  %45 = call i64 @llvm.expect.i64(i64 %44, i64 0)
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %49

47:                                               ; preds = %38
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %48, ptr noundef @.str.30, ptr noundef @__func__.dxb_set_readahead, i32 noundef 402) #10
  unreachable

49:                                               ; preds = %38
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50, %20
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !13
  %55 = zext i8 %54 to i32
  %56 = and i32 %55, 1
  %57 = icmp ne i32 %56, 0
  %58 = xor i1 %57, true
  %59 = xor i1 %58, true
  %60 = zext i1 %59 to i32
  %61 = sext i32 %60 to i64
  %62 = call i64 @llvm.expect.i64(i64 %61, i64 1)
  %63 = icmp ne i64 %62, 0
  br i1 %63, label %64, label %87

64:                                               ; preds = %53
  br label %65

65:                                               ; preds = %64
  %66 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %67 = trunc i8 %66 to i1
  %68 = zext i1 %67 to i32
  %69 = and i32 %68, 1
  %70 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %71 = trunc i8 %70 to i1
  %72 = zext i1 %71 to i32
  %73 = icmp ne i32 %72, 0
  %74 = zext i1 %73 to i32
  %75 = icmp eq i32 %69, %74
  %76 = xor i1 %75, true
  %77 = xor i1 %76, true
  %78 = xor i1 %77, true
  %79 = zext i1 %78 to i32
  %80 = sext i32 %79 to i64
  %81 = call i64 @llvm.expect.i64(i64 %80, i64 0)
  %82 = icmp ne i64 %81, 0
  br i1 %82, label %83, label %85

83:                                               ; preds = %65
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %84, ptr noundef @.str.31, ptr noundef @__func__.dxb_set_readahead, i32 noundef 403) #10
  unreachable

85:                                               ; preds = %65
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86, %53
  br label %88

88:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #11
  %89 = load i8, ptr %9, align 1, !tbaa !11, !range !16, !noundef !17
  %90 = trunc i8 %89 to i1
  br i1 %90, label %111, label %91

91:                                               ; preds = %88
  %92 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %93 = trunc i8 %92 to i1
  %94 = zext i1 %93 to i32
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.MDBX_env, ptr %95, i32 0, i32 7
  %97 = load ptr, ptr %96, align 8, !tbaa !18
  %98 = getelementptr inbounds %struct.shared_lck, ptr %97, i32 0, i32 17
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = xor i32 %94, %99
  %101 = and i32 %100, 1
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %111, label %103

103:                                              ; preds = %91
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.MDBX_env, ptr %104, i32 0, i32 7
  %106 = load ptr, ptr %105, align 8, !tbaa !18
  %107 = getelementptr inbounds %struct.shared_lck, ptr %106, i32 0, i32 17
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = icmp ne i32 %108, 0
  %110 = xor i1 %109, true
  br label %111

111:                                              ; preds = %103, %91, %88
  %112 = phi i1 [ true, %91 ], [ true, %88 ], [ %110, %103 ]
  %113 = zext i1 %112 to i8
  store i8 %113, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #11
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.MDBX_env, ptr %114, i32 0, i32 7
  %116 = load ptr, ptr %115, align 8, !tbaa !18
  %117 = getelementptr inbounds %struct.shared_lck, ptr %116, i32 0, i32 17
  %118 = load i32, ptr %117, align 4, !tbaa !9
  %119 = lshr i32 %118, 1
  store i32 %119, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #11
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.MDBX_env, ptr %120, i32 0, i32 3
  %122 = getelementptr inbounds %struct.osal_mmap, ptr %121, i32 0, i32 2
  %123 = load i64, ptr %122, align 8, !tbaa !28
  store i64 %123, ptr %12, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #11
  %124 = load i8, ptr %10, align 1, !tbaa !11, !range !16, !noundef !17
  %125 = trunc i8 %124 to i1
  br i1 %125, label %126, label %127

126:                                              ; preds = %111
  br label %140

127:                                              ; preds = %111
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = load i32, ptr %11, align 4, !tbaa !9
  %130 = load i32, ptr %7, align 4, !tbaa !9
  %131 = icmp ult i32 %129, %130
  br i1 %131, label %132, label %134

132:                                              ; preds = %127
  %133 = load i32, ptr %11, align 4, !tbaa !9
  br label %136

134:                                              ; preds = %127
  %135 = load i32, ptr %7, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %134, %132
  %137 = phi i32 [ %133, %132 ], [ %135, %134 ]
  %138 = zext i32 %137 to i64
  %139 = call i64 @pgno_align2os_bytes(ptr noundef %128, i64 noundef %138) #12
  br label %140

140:                                              ; preds = %136, %126
  %141 = phi i64 [ 0, %126 ], [ %139, %136 ]
  store i64 %141, ptr %13, align 8, !tbaa !29
  %142 = load i64, ptr %13, align 8, !tbaa !29
  %143 = load i64, ptr %12, align 8, !tbaa !29
  %144 = icmp ult i64 %142, %143
  br i1 %144, label %145, label %147

145:                                              ; preds = %140
  %146 = load i64, ptr %13, align 8, !tbaa !29
  br label %149

147:                                              ; preds = %140
  %148 = load i64, ptr %12, align 8, !tbaa !29
  br label %149

149:                                              ; preds = %147, %145
  %150 = phi i64 [ %146, %145 ], [ %148, %147 ]
  store i64 %150, ptr %13, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #11
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = load i32, ptr %11, align 4, !tbaa !9
  %153 = load i32, ptr %7, align 4, !tbaa !9
  %154 = icmp ult i32 %152, %153
  br i1 %154, label %155, label %157

155:                                              ; preds = %149
  %156 = load i32, ptr %7, align 4, !tbaa !9
  br label %159

157:                                              ; preds = %149
  %158 = load i32, ptr %11, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %157, %155
  %160 = phi i32 [ %156, %155 ], [ %158, %157 ]
  %161 = zext i32 %160 to i64
  %162 = call i64 @pgno_align2os_bytes(ptr noundef %151, i64 noundef %161) #12
  store i64 %162, ptr %14, align 8, !tbaa !29
  %163 = load i64, ptr %14, align 8, !tbaa !29
  %164 = load i64, ptr %12, align 8, !tbaa !29
  %165 = icmp ult i64 %163, %164
  br i1 %165, label %166, label %168

166:                                              ; preds = %159
  %167 = load i64, ptr %14, align 8, !tbaa !29
  br label %170

168:                                              ; preds = %159
  %169 = load i64, ptr %12, align 8, !tbaa !29
  br label %170

170:                                              ; preds = %168, %166
  %171 = phi i64 [ %167, %166 ], [ %169, %168 ]
  store i64 %171, ptr %14, align 8, !tbaa !29
  %172 = load i64, ptr %13, align 8, !tbaa !29
  %173 = load i64, ptr %14, align 8, !tbaa !29
  %174 = sub i64 %173, %172
  store i64 %174, ptr %14, align 8, !tbaa !29
  br label %175

175:                                              ; preds = %170
  %176 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !13
  %177 = zext i8 %176 to i32
  %178 = and i32 %177, 1
  %179 = icmp ne i32 %178, 0
  %180 = xor i1 %179, true
  %181 = xor i1 %180, true
  %182 = zext i1 %181 to i32
  %183 = sext i32 %182 to i64
  %184 = call i64 @llvm.expect.i64(i64 %183, i64 1)
  %185 = icmp ne i64 %184, 0
  br i1 %185, label %186, label %202

186:                                              ; preds = %175
  br label %187

187:                                              ; preds = %186
  %188 = load i64, ptr %14, align 8, !tbaa !29
  %189 = icmp sle i64 0, %188
  %190 = xor i1 %189, true
  %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 %199

197:                                              ; preds = %187
  %198 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %198, ptr noundef @.str.32, ptr noundef @__func__.dxb_set_readahead, i32 noundef 414) #10
  unreachable

199:                                              ; preds = %187
  br label %200

200:                                              ; preds = %199
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201, %175
  br label %203

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203
  %205 = load i64, ptr %14, align 8, !tbaa !29
  %206 = icmp eq i64 %205, 0
  br i1 %206, label %207, label %208

207:                                              ; preds = %204
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %347

208:                                              ; preds = %204
  br label %209

209:                                              ; preds = %208
  %210 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 5), align 2, !tbaa !30
  %211 = zext i8 %210 to i32
  %212 = icmp sle i32 3, %211
  %213 = xor i1 %212, true
  %214 = xor i1 %213, true
  %215 = zext i1 %214 to i32
  %216 = sext i32 %215 to i64
  %217 = call i64 @llvm.expect.i64(i64 %216, i64 0)
  %218 = icmp ne i64 %217, 0
  br i1 %218, label %219, label %232

219:                                              ; preds = %209
  %220 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %221 = trunc i8 %220 to i1
  %222 = zext i1 %221 to i64
  %223 = select i1 %221, ptr @.str.34, ptr @.str.35
  %224 = load ptr, ptr %6, align 8, !tbaa !5
  %225 = load i64, ptr %13, align 8, !tbaa !29
  %226 = call i32 @bytes2pgno(ptr noundef %224, i64 noundef %225) #12
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = load i64, ptr %13, align 8, !tbaa !29
  %229 = load i64, ptr %14, align 8, !tbaa !29
  %230 = add i64 %228, %229
  %231 = call i32 @bytes2pgno(ptr noundef %227, i64 noundef %230) #12
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 3, ptr noundef @__func__.dxb_set_readahead, i32 noundef 418, ptr noundef @.str.33, ptr noundef %223, i32 noundef %226, i32 noundef %231)
  br label %232

232:                                              ; preds = %219, %209
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #11
  %235 = load ptr, ptr %6, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.MDBX_env, ptr %235, i32 0, i32 3
  %237 = getelementptr inbounds %struct.osal_mmap, ptr %236, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !31
  %239 = ptrtoint ptr %238 to i64
  %240 = load i64, ptr %13, align 8, !tbaa !29
  %241 = add nsw i64 %239, %240
  %242 = inttoptr i64 %241 to ptr
  store ptr %242, ptr %17, align 8, !tbaa !5
  %243 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %244 = trunc i8 %243 to i1
  br i1 %244, label %245, label %304

245:                                              ; preds = %234
  %246 = load ptr, ptr %17, align 8, !tbaa !5
  %247 = load i64, ptr %14, align 8, !tbaa !29
  %248 = call i32 @madvise(ptr noundef %246, i64 noundef %247, i32 noundef 0) #11
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %250, label %254

250:                                              ; preds = %245
  %251 = call ptr @__errno_location() #13
  %252 = load i32, ptr %251, align 4, !tbaa !9
  %253 = call i32 @ignore_enosys(i32 noundef %252)
  br label %255

254:                                              ; preds = %245
  br label %255

255:                                              ; preds = %254, %250
  %256 = phi i32 [ %253, %250 ], [ 0, %254 ]
  store i32 %256, ptr %16, align 4, !tbaa !9
  %257 = load i32, ptr %16, align 4, !tbaa !9
  %258 = icmp ne i32 %257, -1
  br i1 %258, label %259, label %262

259:                                              ; preds = %255
  %260 = load i32, ptr %16, align 4, !tbaa !9
  %261 = icmp ne i32 %260, 0
  br label %262

262:                                              ; preds = %259, %255
  %263 = phi i1 [ false, %255 ], [ %261, %259 ]
  %264 = xor i1 %263, true
  %265 = xor i1 %264, true
  %266 = zext i1 %265 to i32
  %267 = sext i32 %266 to i64
  %268 = call i64 @llvm.expect.i64(i64 %267, i64 0)
  %269 = icmp ne i64 %268, 0
  br i1 %269, label %270, label %272

270:                                              ; preds = %262
  %271 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %271, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %346

272:                                              ; preds = %262
  %273 = load i8, ptr %10, align 1, !tbaa !11, !range !16, !noundef !17
  %274 = trunc i8 %273 to i1
  br i1 %274, label %275, label %303

275:                                              ; preds = %272
  %276 = load ptr, ptr %17, align 8, !tbaa !5
  %277 = load i64, ptr %14, align 8, !tbaa !29
  %278 = call i32 @madvise(ptr noundef %276, i64 noundef %277, i32 noundef 3) #11
  %279 = icmp ne i32 %278, 0
  br i1 %279, label %280, label %284

280:                                              ; preds = %275
  %281 = call ptr @__errno_location() #13
  %282 = load i32, ptr %281, align 4, !tbaa !9
  %283 = call i32 @ignore_enosys(i32 noundef %282)
  br label %285

284:                                              ; preds = %275
  br label %285

285:                                              ; preds = %284, %280
  %286 = phi i32 [ %283, %280 ], [ 0, %284 ]
  store i32 %286, ptr %16, align 4, !tbaa !9
  %287 = load i32, ptr %16, align 4, !tbaa !9
  %288 = icmp ne i32 %287, -1
  br i1 %288, label %289, label %292

289:                                              ; preds = %285
  %290 = load i32, ptr %16, align 4, !tbaa !9
  %291 = icmp ne i32 %290, 0
  br label %292

292:                                              ; preds = %289, %285
  %293 = phi i1 [ false, %285 ], [ %291, %289 ]
  %294 = xor i1 %293, true
  %295 = xor i1 %294, true
  %296 = zext i1 %295 to i32
  %297 = sext i32 %296 to i64
  %298 = call i64 @llvm.expect.i64(i64 %297, i64 0)
  %299 = icmp ne i64 %298, 0
  br i1 %299, label %300, label %302

300:                                              ; preds = %292
  %301 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %301, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %346

302:                                              ; preds = %292
  br label %303

303:                                              ; preds = %302, %272
  br label %333

304:                                              ; preds = %234
  %305 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mincore_clean_cache(ptr noundef %305)
  %306 = load ptr, ptr %17, align 8, !tbaa !5
  %307 = load i64, ptr %14, align 8, !tbaa !29
  %308 = call i32 @madvise(ptr noundef %306, i64 noundef %307, i32 noundef 1) #11
  %309 = icmp ne i32 %308, 0
  br i1 %309, label %310, label %314

310:                                              ; preds = %304
  %311 = call ptr @__errno_location() #13
  %312 = load i32, ptr %311, align 4, !tbaa !9
  %313 = call i32 @ignore_enosys(i32 noundef %312)
  br label %315

314:                                              ; preds = %304
  br label %315

315:                                              ; preds = %314, %310
  %316 = phi i32 [ %313, %310 ], [ 0, %314 ]
  store i32 %316, ptr %16, align 4, !tbaa !9
  %317 = load i32, ptr %16, align 4, !tbaa !9
  %318 = icmp ne i32 %317, -1
  br i1 %318, label %319, label %322

319:                                              ; preds = %315
  %320 = load i32, ptr %16, align 4, !tbaa !9
  %321 = icmp ne i32 %320, 0
  br label %322

322:                                              ; preds = %319, %315
  %323 = phi i1 [ false, %315 ], [ %321, %319 ]
  %324 = xor i1 %323, true
  %325 = xor i1 %324, true
  %326 = zext i1 %325 to i32
  %327 = sext i32 %326 to i64
  %328 = call i64 @llvm.expect.i64(i64 %327, i64 0)
  %329 = icmp ne i64 %328, 0
  br i1 %329, label %330, label %332

330:                                              ; preds = %322
  %331 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %331, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %346

332:                                              ; preds = %322
  br label %333

333:                                              ; preds = %332, %303
  %334 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %335 = trunc i8 %334 to i1
  %336 = zext i1 %335 to i32
  %337 = and i32 %336, 1
  %338 = load i32, ptr %7, align 4, !tbaa !9
  %339 = shl i32 %338, 1
  %340 = add i32 %337, %339
  %341 = load ptr, ptr %6, align 8, !tbaa !5
  %342 = getelementptr inbounds %struct.MDBX_env, ptr %341, i32 0, i32 7
  %343 = load ptr, ptr %342, align 8, !tbaa !18
  %344 = getelementptr inbounds %struct.shared_lck, ptr %343, i32 0, i32 17
  store i32 %340, ptr %344, align 4, !tbaa !9
  store i32 0, ptr %16, align 4, !tbaa !9
  %345 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %345, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %346

346:                                              ; preds = %333, %330, %300, %270
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #11
  br label %347

347:                                              ; preds = %346, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #11
  %348 = load i32, ptr %5, align 4
  ret i32 %348
}

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 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 #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 willreturn memory(read) "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 = { 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 willreturn memory(none) "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 = { 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 #10 = { noreturn }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { nounwind willreturn memory(none) }

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


; 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.5 }
%struct.anon.5 = 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.30 = external hidden unnamed_addr constant [37 x i8], align 1
@__func__.dxb_set_readahead = external hidden unnamed_addr constant [18 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i64 @pgno_align2os_bytes(ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @mincore_clean_cache(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare i32 @madvise(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ignore_enosys(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #6

; Function Attrs: cold nounwind optsize uwtable
define dso_local range(i32 0, -1) i32 @dxb_set_readahead(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3) local_unnamed_addr #7 {
  %5 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !5
  %6 = and i8 %5, 1
  %.not = icmp ne i8 %6, 0
  %7 = add i32 %1, 2147483647
  %8 = icmp ult i32 %7, -2147483646
  %or.cond = and i1 %8, %.not
  br i1 %or.cond, label %9, label %10, !prof !13

9:                                                ; preds = %4
  tail call void @mdbx_assert_fail(ptr noundef %0, ptr noundef nonnull @.str.30, ptr noundef nonnull @__func__.dxb_set_readahead, i32 noundef 402) #9
  unreachable

10:                                               ; preds = %4
  %11 = getelementptr inbounds i8, ptr %0, i64 104
  %12 = load ptr, ptr %11, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %12, i64 396
  %14 = load i32, ptr %13, align 4, !tbaa !24
  br i1 %3, label %.thread, label %18

.thread:                                          ; preds = %10
  %15 = lshr i32 %14, 1
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = load i64, ptr %16, align 8, !tbaa !25
  br label %26

18:                                               ; preds = %10
  %.tr = trunc i32 %14 to i1
  %.narrow = xor i1 %.tr, %2
  %.not71 = icmp eq i32 %14, 0
  %spec.select = or i1 %.not71, %.narrow
  %19 = lshr i32 %14, 1
  %20 = getelementptr inbounds i8, ptr %0, i64 32
  %21 = load i64, ptr %20, align 8, !tbaa !25
  br i1 %spec.select, label %26, label %22

22:                                               ; preds = %18
  %23 = tail call i32 @llvm.umin.i32(i32 %19, i32 %1)
  %24 = zext nneg i32 %23 to i64
  %25 = tail call i64 @pgno_align2os_bytes(ptr noundef nonnull %0, i64 noundef %24) #10
  br label %26

26:                                               ; preds = %.thread, %18, %22
  %27 = phi i64 [ %21, %22 ], [ %21, %18 ], [ %17, %.thread ]
  %28 = phi i32 [ %19, %22 ], [ %19, %18 ], [ %15, %.thread ]
  %29 = phi i1 [ false, %22 ], [ true, %18 ], [ true, %.thread ]
  %30 = phi i64 [ %25, %22 ], [ 0, %18 ], [ 0, %.thread ]
  %31 = getelementptr inbounds i8, ptr %0, i64 16
  %32 = tail call i64 @llvm.umin.i64(i64 %30, i64 %27)
  %33 = tail call i32 @llvm.umax.i32(i32 %28, i32 %1)
  %34 = zext i32 %33 to i64
  %35 = tail call i64 @pgno_align2os_bytes(ptr noundef nonnull %0, i64 noundef %34) #10
  %36 = tail call i64 @llvm.umin.i64(i64 %35, i64 %27)
  %37 = sub i64 %36, %32
  %38 = icmp slt i64 %37, 0
  %or.cond77 = select i1 %.not, i1 %38, i1 false
  br i1 %or.cond77, label %39, label %40, !prof !13

39:                                               ; preds = %26
  tail call void @mdbx_assert_fail(ptr noundef nonnull %0, ptr noundef nonnull @.str.32, ptr noundef nonnull @__func__.dxb_set_readahead, i32 noundef 414) #9
  unreachable

40:                                               ; preds = %26
  %41 = icmp eq i64 %36, %32
  br i1 %41, label %83, label %42

42:                                               ; preds = %40
  %43 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !26
  %44 = icmp ugt i8 %43, 2
  br i1 %44, label %45, label %49, !prof !27

45:                                               ; preds = %42
  %46 = select i1 %2, ptr @.str.34, ptr @.str.35
  %47 = tail call i32 @bytes2pgno(ptr noundef nonnull %0, i64 noundef %32) #10
  %48 = tail call i32 @bytes2pgno(ptr noundef nonnull %0, i64 noundef %36) #10
  tail call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 3, ptr noundef nonnull @__func__.dxb_set_readahead, i32 noundef 418, ptr noundef nonnull @.str.33, ptr noundef nonnull %46, i32 noundef %47, i32 noundef %48) #11
  br label %49

49:                                               ; preds = %45, %42
  %50 = load ptr, ptr %31, align 8, !tbaa !28
  %51 = ptrtoint ptr %50 to i64
  %52 = add nsw i64 %32, %51
  %53 = inttoptr i64 %52 to ptr
  br i1 %2, label %54, label %70

54:                                               ; preds = %49
  %55 = tail call i32 @madvise(ptr noundef %53, i64 noundef %37, i32 noundef 0) #11
  %.not74 = icmp eq i32 %55, 0
  br i1 %.not74, label %.thread78, label %56

56:                                               ; preds = %54
  %57 = tail call ptr @__errno_location() #12
  %58 = load i32, ptr %57, align 4, !tbaa !24
  %59 = tail call i32 @ignore_enosys(i32 noundef %58)
  %60 = add i32 %59, -1
  %61 = icmp ult i32 %60, -2
  br i1 %61, label %83, label %.thread78, !prof !29

.thread78:                                        ; preds = %54, %56
  br i1 %29, label %62, label %.thread79

62:                                               ; preds = %.thread78
  %63 = tail call i32 @madvise(ptr noundef %53, i64 noundef %37, i32 noundef 3) #11
  %.not75 = icmp eq i32 %63, 0
  br i1 %.not75, label %.thread79, label %64

64:                                               ; preds = %62
  %65 = tail call ptr @__errno_location() #12
  %66 = load i32, ptr %65, align 4, !tbaa !24
  %67 = tail call i32 @ignore_enosys(i32 noundef %66)
  %68 = add i32 %67, -1
  %69 = icmp ult i32 %68, -2
  br i1 %69, label %83, label %.thread79, !prof !29

70:                                               ; preds = %49
  tail call void @mincore_clean_cache(ptr noundef nonnull %0) #11
  %71 = tail call i32 @madvise(ptr noundef %53, i64 noundef %37, i32 noundef 1) #11
  %.not73 = icmp eq i32 %71, 0
  br i1 %.not73, label %.thread79, label %72

72:                                               ; preds = %70
  %73 = tail call ptr @__errno_location() #12
  %74 = load i32, ptr %73, align 4, !tbaa !24
  %75 = tail call i32 @ignore_enosys(i32 noundef %74)
  %76 = add i32 %75, -1
  %77 = icmp ult i32 %76, -2
  br i1 %77, label %83, label %.thread79, !prof !29

.thread79:                                        ; preds = %70, %62, %72, %.thread78, %64
  %78 = zext i1 %2 to i32
  %79 = shl i32 %1, 1
  %80 = or disjoint i32 %79, %78
  %81 = load ptr, ptr %11, align 8, !tbaa !14
  %82 = getelementptr inbounds i8, ptr %81, i64 396
  store i32 %80, ptr %82, align 4, !tbaa !24
  br label %83

83:                                               ; preds = %.thread79, %56, %64, %72, %40
  %.1 = phi i32 [ 0, %40 ], [ 0, %.thread79 ], [ %59, %56 ], [ %67, %64 ], [ %75, %72 ]
  ret i32 %.1
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #8

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 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 #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 nofree nounwind willreturn memory(read) "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 "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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { noreturn nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(none) }

!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 25}
!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", i32 2000, i32 4002001}
!14 = !{!15, !12, i64 104}
!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, !11, i64 32}
!26 = !{!6, !7, i64 26}
!27 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!28 = !{!7, !7, i64 0}
!29 = !{!"branch_weights", !"expected", i32 1717128, i32 2145766520}


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