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

; 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.14 }
%struct.anon.14 = 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.troika = type { i8, i8, i8, i8, i32, [3 x i64] }
%struct.meta_ptr = type { i64, %union.anon.16, i64 }
%union.anon.16 = type { ptr }
%struct.meta = type { [2 x i32], %union.anon.20, i16, i8, i8, %struct.geo, %union.anon.21, %struct.MDBX_canary, %union.anon.24, [2 x %union.mdbx_atomic_uint32_t], [2 x i32], %union.bin128, %union.bin128 }
%union.anon.20 = type { i64 }
%struct.geo = type { i16, i16, i32, i32, %union.anon.6, %union.anon.7 }
%union.anon.6 = type { i32 }
%union.anon.7 = type { i32 }
%union.anon.21 = type { %struct.anon.22 }
%struct.anon.22 = type { %struct.tree, %struct.tree }
%struct.tree = type { i16, i16, i32, i32, i32, i32, i32, i64, i64, i64 }
%struct.MDBX_canary = type { i64, i64, i64, i64 }
%union.anon.24 = type { i64 }
%union.mdbx_atomic_uint32_t = type { i32 }
%struct.MDBX_env = type { %union.mdbx_atomic_uint32_t, i32, i32, %struct.osal_mmap, i32, i32, %struct.osal_mmap, ptr, i16, i16, i16, i16, i16, i16, %union.mdbx_atomic_uint32_t, i8, i8, i16, i32, i32, i32, i32, %struct.anon, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i64, %struct.anon.0, %struct.anon.4, i8, ptr, ptr, ptr, %struct.anon.5, %union.pthread_mutex_t, i32, i32, ptr, %struct.osal_ioring, %union.pthread_mutex_t, [71 x %union.mdbx_atomic_uint64_t] }
%struct.osal_mmap = type { %union.anon, i32, i64, i64, i64 }
%union.anon = type { ptr }
%struct.anon = type { ptr, ptr, ptr, ptr }
%struct.anon.0 = type { i32, i32, i32, i32, i64, i8, i8, i8, i8, i32, i32, i8, i8, i8, %struct.anon.1, %union.anon.2 }
%struct.anon.1 = type { i16, i16, i16, i16 }
%union.anon.2 = type { i32 }
%struct.anon.4 = type { i64, i64, i64, i64, i64 }
%struct.anon.5 = type { i64 }
%struct.osal_ioring = type { i32, i32, i32, ptr, ptr, ptr }
%union.mdbx_atomic_uint64_t = type { i64 }
%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.8 }
%union.anon.8 = type { %struct.anon.10 }
%struct.anon.10 = type { %struct.troika, ptr, %struct.anon.11, i8, i32, i32, i64, ptr, ptr, ptr, i64, %union.anon.12 }
%struct.anon.11 = type { %struct.MDBX_rkl, i64, %struct.MDBX_rkl }
%struct.MDBX_rkl = type { i64, i64, i32, i32, ptr, [12 x i64] }
%union.anon.12 = type { %struct.anon.13 }
%struct.anon.13 = type { i64, ptr }
%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.19, %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.17 }
%struct.anon.17 = 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.18 }
%struct.anon.18 = type { i64, i64, i32 }
%struct.anon.19 = 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 }
%struct.page = type <{ i64, i16, i16, %union.anon.25, i32, [0 x i16] }>
%union.anon.25 = type { i32 }

@globals = external global %struct.libmdbx_globals, align 8
@__func__.env_sync = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @env_owned_wrtxn(ptr noundef) #0

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

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

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

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

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

; Function Attrs: cold nounwind optsize uwtable
define dso_local i32 @env_sync(ptr noundef %0, i1 noundef zeroext %1, i1 noundef zeroext %2) #5 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.troika, align 8
  %13 = alloca %struct.meta_ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca %struct.troika, align 8
  %25 = alloca %struct.meta, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  %26 = zext i1 %1 to i8
  store i8 %26, ptr %6, align 1, !tbaa !9
  %27 = zext i1 %2 to i8
  store i8 %27, ptr %7, align 1, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.MDBX_env, ptr %28, i32 0, i32 1
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = and i32 %30, 131072
  %32 = icmp ne i32 %31, 0
  %33 = xor i1 %32, true
  %34 = xor i1 %33, true
  %35 = zext i1 %34 to i32
  %36 = sext i32 %35 to i64
  %37 = call i64 @llvm.expect.i64(i64 %36, i64 0)
  %38 = icmp ne i64 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %3
  store i32 13, ptr %4, align 4
  br label %679

40:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #11
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call ptr @env_owned_wrtxn(ptr noundef %41)
  store ptr %42, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #11
  store i8 0, ptr %9, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #11
  store i32 -1, ptr %10, align 4, !tbaa !23
  br label %43

43:                                               ; preds = %433, %40
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.MDBX_env, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = and i32 %46, -1074003969
  store i32 %47, ptr %11, align 4, !tbaa !23
  %48 = load i32, ptr %11, align 4, !tbaa !23
  %49 = and i32 %48, -1610612736
  %50 = icmp ne i32 %49, 536870912
  %51 = xor i1 %50, true
  %52 = xor i1 %51, true
  %53 = zext i1 %52 to i32
  %54 = sext i32 %53 to i64
  %55 = call i64 @llvm.expect.i64(i64 %54, i64 0)
  %56 = icmp ne i64 %55, 0
  br i1 %56, label %57, label %63

57:                                               ; preds = %43
  %58 = load i32, ptr %11, align 4, !tbaa !23
  %59 = and i32 %58, -2147483648
  %60 = icmp ne i32 %59, 0
  %61 = zext i1 %60 to i64
  %62 = select i1 %60, i32 -30795, i32 1
  store i32 %62, ptr %10, align 4, !tbaa !23
  br label %671

63:                                               ; preds = %43
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %69, label %66

66:                                               ; preds = %63
  %67 = load i8, ptr %9, align 1, !tbaa !9, !range !24, !noundef !25
  %68 = trunc i8 %67 to i1
  br i1 %68, label %69, label %75

69:                                               ; preds = %66, %63
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.MDBX_env, ptr %70, i32 0, i32 24
  %72 = load ptr, ptr %71, align 8, !tbaa !26
  %73 = getelementptr inbounds %struct.MDBX_txn, ptr %72, i32 0, i32 17
  %74 = getelementptr inbounds %struct.anon.10, ptr %73, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %74, i64 32, i1 false), !tbaa.struct !27
  br label %77

75:                                               ; preds = %66
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  call void @meta_tap(ptr dead_on_unwind writable sret(%struct.troika) align 8 %12, ptr noundef %76)
  br label %77

77:                                               ; preds = %75, %69
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  call void @meta_recent(ptr dead_on_unwind writable sret(%struct.meta_ptr) align 8 %13, ptr noundef %78, ptr noundef %12)
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.MDBX_env, ptr %79, i32 0, i32 7
  %81 = load ptr, ptr %80, align 8, !tbaa !29
  %82 = getelementptr inbounds %struct.shared_lck, ptr %81, i32 0, i32 14
  %83 = call i64 @atomic_load64(ptr noundef %82, i32 noundef 0)
  store i64 %83, ptr %14, align 8, !tbaa !30
  %84 = load i64, ptr %14, align 8, !tbaa !30
  %85 = icmp eq i64 %84, 0
  br i1 %85, label %86, label %106

86:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #11
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.MDBX_env, ptr %87, i32 0, i32 7
  %89 = load ptr, ptr %88, align 8, !tbaa !29
  %90 = getelementptr inbounds %struct.shared_lck, ptr %89, i32 0, i32 4
  %91 = call i32 @atomic_load32(ptr noundef %90, i32 noundef 0)
  store i32 %91, ptr %15, align 4, !tbaa !23
  %92 = load i32, ptr %15, align 4, !tbaa !23
  %93 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 0
  %94 = load i64, ptr %93, align 8, !tbaa !31
  %95 = trunc i64 %94 to i32
  %96 = icmp eq i32 %92, %95
  br i1 %96, label %97, label %102

97:                                               ; preds = %86
  %98 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 2
  %99 = load i64, ptr %98, align 8, !tbaa !33
  %100 = icmp ne i64 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %97
  store i32 3, ptr %16, align 4
  br label %103

102:                                              ; preds = %97, %86
  store i32 0, ptr %16, align 4
  br label %103

103:                                              ; preds = %102, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #11
  %104 = load i32, ptr %16, align 4
  switch i32 %104, label %678 [
    i32 0, label %105
    i32 3, label %671
  ]

105:                                              ; preds = %103
  br label %106

106:                                              ; preds = %105, %77
  %107 = load i8, ptr %9, align 1, !tbaa !9, !range !24, !noundef !25
  %108 = trunc i8 %107 to i1
  br i1 %108, label %109, label %206

109:                                              ; preds = %106
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MDBX_env, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !11
  %113 = and i32 %112, 524288
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %206

115:                                              ; preds = %109
  %116 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !28
  %118 = getelementptr inbounds %struct.meta, ptr %117, i32 0, i32 5
  %119 = getelementptr inbounds %struct.geo, ptr %118, i32 0, i32 5
  %120 = load i32, ptr %119, align 4, !tbaa !28
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.MDBX_env, ptr %122, i32 0, i32 3
  %124 = getelementptr inbounds %struct.osal_mmap, ptr %123, i32 0, i32 3
  %125 = load i64, ptr %124, align 8, !tbaa !34
  %126 = call i32 @bytes2pgno(ptr noundef %121, i64 noundef %125) #12
  %127 = icmp ugt i32 %120, %126
  %128 = xor i1 %127, true
  %129 = xor i1 %128, true
  %130 = zext i1 %129 to i32
  %131 = sext i32 %130 to i64
  %132 = call i64 @llvm.expect.i64(i64 %131, i64 0)
  %133 = icmp ne i64 %132, 0
  br i1 %133, label %134, label %206

134:                                              ; preds = %115
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.MDBX_env, ptr %135, i32 0, i32 16
  %137 = load i8, ptr %136, align 1, !tbaa !35
  %138 = sext i8 %137 to i32
  %139 = icmp sge 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 0)
  %145 = icmp ne i64 %144, 0
  br i1 %145, label %146, label %177

146:                                              ; preds = %134
  %147 = getelementptr inbounds %struct.troika, ptr %12, i32 0, i32 1
  %148 = load i8, ptr %147, align 1, !tbaa !36
  %149 = zext i8 %148 to i32
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.MDBX_env, ptr %150, i32 0, i32 16
  %152 = load i8, ptr %151, align 1, !tbaa !35
  %153 = zext i8 %152 to i32
  %154 = icmp ne i32 %149, %153
  br i1 %154, label %155, label %177

155:                                              ; preds = %146
  br label %156

156:                                              ; preds = %155
  %157 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 5), align 2, !tbaa !38
  %158 = zext i8 %157 to i32
  %159 = icmp sle i32 3, %158
  %160 = xor i1 %159, true
  %161 = xor i1 %160, true
  %162 = zext i1 %161 to i32
  %163 = sext i32 %162 to i64
  %164 = call i64 @llvm.expect.i64(i64 %163, i64 0)
  %165 = icmp ne i64 %164, 0
  br i1 %165, label %166, label %174

166:                                              ; preds = %156
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.MDBX_env, ptr %167, i32 0, i32 16
  %169 = load i8, ptr %168, align 1, !tbaa !35
  %170 = sext i8 %169 to i32
  %171 = getelementptr inbounds %struct.troika, ptr %12, i32 0, i32 1
  %172 = load i8, ptr %171, align 1, !tbaa !36
  %173 = zext i8 %172 to i32
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 3, ptr noundef @__func__.env_sync, i32 noundef 94, ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef %170, i32 noundef %173)
  br label %174

174:                                              ; preds = %166, %156
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  store i32 -1, ptr %10, align 4, !tbaa !23
  br label %205

177:                                              ; preds = %146, %134
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 1
  %180 = load ptr, ptr %179, align 8, !tbaa !28
  %181 = getelementptr inbounds %struct.meta, ptr %180, i32 0, i32 5
  %182 = getelementptr inbounds %struct.geo, ptr %181, i32 0, i32 5
  %183 = load i32, ptr %182, align 4, !tbaa !28
  %184 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 1
  %185 = load ptr, ptr %184, align 8, !tbaa !28
  %186 = getelementptr inbounds %struct.meta, ptr %185, i32 0, i32 5
  %187 = getelementptr inbounds %struct.geo, ptr %186, i32 0, i32 4
  %188 = load i32, ptr %187, align 4, !tbaa !28
  %189 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 1
  %190 = load ptr, ptr %189, align 8, !tbaa !28
  %191 = getelementptr inbounds %struct.meta, ptr %190, i32 0, i32 5
  %192 = getelementptr inbounds %struct.geo, ptr %191, i32 0, i32 3
  %193 = load i32, ptr %192, align 4, !tbaa !40
  %194 = call i32 @dxb_resize(ptr noundef %178, i32 noundef %183, i32 noundef %188, i32 noundef %193, i32 noundef 0)
  store i32 %194, ptr %10, align 4, !tbaa !23
  %195 = load i32, ptr %10, align 4, !tbaa !23
  %196 = icmp ne i32 %195, 0
  %197 = xor i1 %196, true
  %198 = xor i1 %197, true
  %199 = zext i1 %198 to i32
  %200 = sext i32 %199 to i64
  %201 = call i64 @llvm.expect.i64(i64 %200, i64 0)
  %202 = icmp ne i64 %201, 0
  br i1 %202, label %203, label %204

203:                                              ; preds = %177
  br label %671

204:                                              ; preds = %177
  br label %205

205:                                              ; preds = %204, %176
  br label %206

206:                                              ; preds = %205, %115, %109, %106
  %207 = load ptr, ptr %5, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.MDBX_env, ptr %207, i32 0, i32 7
  %209 = load ptr, ptr %208, align 8, !tbaa !29
  %210 = getelementptr inbounds %struct.shared_lck, ptr %209, i32 0, i32 3
  %211 = call i32 @atomic_load32(ptr noundef %210, i32 noundef 0)
  %212 = zext i32 %211 to i64
  store i64 %212, ptr %17, align 8, !tbaa !30
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.MDBX_env, ptr %213, i32 0, i32 7
  %215 = load ptr, ptr %214, align 8, !tbaa !29
  %216 = getelementptr inbounds %struct.shared_lck, ptr %215, i32 0, i32 5
  %217 = call i64 @atomic_load64(ptr noundef %216, i32 noundef 0)
  store i64 %217, ptr %18, align 8, !tbaa !30
  %218 = load i8, ptr %6, align 1, !tbaa !9, !range !24, !noundef !25
  %219 = trunc i8 %218 to i1
  br i1 %219, label %243, label %220

220:                                              ; preds = %206
  %221 = load i64, ptr %17, align 8, !tbaa !30
  %222 = icmp ne i64 %221, 0
  br i1 %222, label %223, label %227

223:                                              ; preds = %220
  %224 = load i64, ptr %14, align 8, !tbaa !30
  %225 = load i64, ptr %17, align 8, !tbaa !30
  %226 = icmp uge i64 %224, %225
  br i1 %226, label %243, label %227

227:                                              ; preds = %223, %220
  %228 = load i64, ptr %18, align 8, !tbaa !30
  %229 = icmp ne i64 %228, 0
  br i1 %229, label %230, label %246

230:                                              ; preds = %227
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.MDBX_env, ptr %231, i32 0, i32 7
  %233 = load ptr, ptr %232, align 8, !tbaa !29
  %234 = getelementptr inbounds %struct.shared_lck, ptr %233, i32 0, i32 13
  %235 = call i64 @atomic_load64(ptr noundef %234, i32 noundef 0)
  store i64 %235, ptr %19, align 8, !tbaa !30
  %236 = icmp ne i64 %235, 0
  br i1 %236, label %237, label %246

237:                                              ; preds = %230
  %238 = call i64 @osal_monotime()
  %239 = load i64, ptr %19, align 8, !tbaa !30
  %240 = sub i64 %238, %239
  %241 = load i64, ptr %18, align 8, !tbaa !30
  %242 = icmp uge i64 %240, %241
  br i1 %242, label %243, label %246

243:                                              ; preds = %237, %223, %206
  %244 = load i32, ptr %11, align 4, !tbaa !23
  %245 = and i32 %244, 524288
  store i32 %245, ptr %11, align 4, !tbaa !23
  br label %246

246:                                              ; preds = %243, %237, %230, %227
  %247 = load ptr, ptr %8, align 8, !tbaa !5
  %248 = icmp ne ptr %247, null
  br i1 %248, label %481, label %249

249:                                              ; preds = %246
  %250 = load i8, ptr %9, align 1, !tbaa !9, !range !24, !noundef !25
  %251 = trunc i8 %250 to i1
  br i1 %251, label %435, label %252

252:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #11
  store i32 0, ptr %20, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #11
  %253 = load i64, ptr %14, align 8, !tbaa !30
  %254 = icmp ugt i64 %253, 42
  br i1 %254, label %255, label %360

255:                                              ; preds = %252
  %256 = load i32, ptr %11, align 4, !tbaa !23
  %257 = and i32 %256, 65536
  %258 = icmp eq i32 %257, 0
  br i1 %258, label %259, label %360

259:                                              ; preds = %255
  br label %260

260:                                              ; preds = %259
  %261 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !44
  %262 = zext i8 %261 to i32
  %263 = and i32 %262, 1
  %264 = icmp ne i32 %263, 0
  %265 = xor i1 %264, true
  %266 = xor i1 %265, true
  %267 = zext i1 %266 to i32
  %268 = sext i32 %267 to i64
  %269 = call i64 @llvm.expect.i64(i64 %268, i64 1)
  %270 = icmp ne i64 %269, 0
  br i1 %270, label %271, label %292

271:                                              ; preds = %260
  br label %272

272:                                              ; preds = %271
  %273 = load i32, ptr %11, align 4, !tbaa !23
  %274 = load ptr, ptr %5, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.MDBX_env, ptr %274, i32 0, i32 1
  %276 = load i32, ptr %275, align 4, !tbaa !11
  %277 = xor i32 %273, %276
  %278 = and i32 %277, 524288
  %279 = icmp eq i32 %278, 0
  %280 = xor i1 %279, true
  %281 = xor i1 %280, true
  %282 = xor i1 %281, true
  %283 = zext i1 %282 to i32
  %284 = sext i32 %283 to i64
  %285 = call i64 @llvm.expect.i64(i64 %284, i64 0)
  %286 = icmp ne i64 %285, 0
  br i1 %286, label %287, label %289

287:                                              ; preds = %272
  %288 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %288, ptr noundef @.str.10, ptr noundef @__func__.env_sync, i32 noundef 121) #13
  unreachable

289:                                              ; preds = %272
  br label %290

290:                                              ; preds = %289
  br label %291

291:                                              ; preds = %290
  br label %292

292:                                              ; preds = %291, %260
  br label %293

293:                                              ; preds = %292
  br label %294

294:                                              ; preds = %293
  %295 = load i32, ptr %11, align 4, !tbaa !23
  %296 = and i32 %295, 524288
  %297 = icmp ne i32 %296, 0
  br i1 %297, label %298, label %342

298:                                              ; preds = %294
  %299 = load ptr, ptr %5, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.MDBX_env, ptr %299, i32 0, i32 46
  %301 = call i32 @osal_fastmutex_acquire(ptr noundef %300)
  store i32 %301, ptr %21, align 4, !tbaa !23
  %302 = load i32, ptr %21, align 4, !tbaa !23
  %303 = icmp ne i32 %302, 0
  %304 = xor i1 %303, true
  %305 = xor i1 %304, true
  %306 = zext i1 %305 to i32
  %307 = sext i32 %306 to i64
  %308 = call i64 @llvm.expect.i64(i64 %307, i64 0)
  %309 = icmp ne i64 %308, 0
  br i1 %309, label %310, label %312

310:                                              ; preds = %298
  %311 = load i32, ptr %21, align 4, !tbaa !23
  store i32 %311, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %433

312:                                              ; preds = %298
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #11
  %313 = load ptr, ptr %5, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 1
  %315 = load ptr, ptr %314, align 8, !tbaa !28
  %316 = getelementptr inbounds %struct.meta, ptr %315, i32 0, i32 5
  %317 = getelementptr inbounds %struct.geo, ptr %316, i32 0, i32 5
  %318 = load i32, ptr %317, align 4, !tbaa !28
  %319 = zext i32 %318 to i64
  %320 = call i64 @pgno_align2os_bytes(ptr noundef %313, i64 noundef %319) #12
  store i64 %320, ptr %22, align 8, !tbaa !30
  %321 = load ptr, ptr %5, align 8, !tbaa !5
  %322 = getelementptr inbounds %struct.MDBX_env, ptr %321, i32 0, i32 3
  %323 = load i64, ptr %22, align 8, !tbaa !30
  %324 = call i32 @osal_msync(ptr noundef %322, i64 noundef 0, i64 noundef %323, i32 noundef 2)
  store i32 %324, ptr %21, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #11
  %325 = load ptr, ptr %5, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.MDBX_env, ptr %325, i32 0, i32 46
  %327 = call i32 @osal_fastmutex_release(ptr noundef %326)
  store i32 %327, ptr %23, align 4, !tbaa !23
  %328 = load i32, ptr %23, align 4, !tbaa !23
  %329 = icmp ne i32 %328, 0
  %330 = xor i1 %329, true
  %331 = xor i1 %330, true
  %332 = zext i1 %331 to i32
  %333 = sext i32 %332 to i64
  %334 = call i64 @llvm.expect.i64(i64 %333, i64 0)
  %335 = icmp ne i64 %334, 0
  br i1 %335, label %336, label %341

336:                                              ; preds = %312
  %337 = load i32, ptr %21, align 4, !tbaa !23
  %338 = icmp eq i32 %337, 0
  br i1 %338, label %339, label %341

339:                                              ; preds = %336
  %340 = load i32, ptr %23, align 4, !tbaa !23
  store i32 %340, ptr %21, align 4, !tbaa !23
  br label %341

341:                                              ; preds = %339, %336, %312
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  br label %348

342:                                              ; preds = %294
  %343 = load ptr, ptr %5, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.MDBX_env, ptr %343, i32 0, i32 3
  %345 = getelementptr inbounds %struct.osal_mmap, ptr %344, i32 0, i32 1
  %346 = load i32, ptr %345, align 8, !tbaa !45
  %347 = call i32 @osal_fsync(i32 noundef %346, i32 noundef 2)
  store i32 %347, ptr %21, align 4, !tbaa !23
  br label %348

348:                                              ; preds = %342, %341
  %349 = load i32, ptr %21, align 4, !tbaa !23
  %350 = icmp ne i32 %349, 0
  %351 = xor i1 %350, true
  %352 = xor i1 %351, true
  %353 = zext i1 %352 to i32
  %354 = sext i32 %353 to i64
  %355 = call i64 @llvm.expect.i64(i64 %354, i64 0)
  %356 = icmp ne i64 %355, 0
  br i1 %356, label %357, label %359

357:                                              ; preds = %348
  %358 = load i32, ptr %21, align 4, !tbaa !23
  store i32 %358, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %433

359:                                              ; preds = %348
  store i32 1, ptr %20, align 4, !tbaa !23
  store i32 0, ptr %10, align 4, !tbaa !23
  br label %360

360:                                              ; preds = %359, %255, %252
  %361 = load ptr, ptr %5, align 8, !tbaa !5
  %362 = load i8, ptr %7, align 1, !tbaa !9, !range !24, !noundef !25
  %363 = trunc i8 %362 to i1
  %364 = call i32 @lck_txn_lock(ptr noundef %361, i1 noundef zeroext %363)
  store i32 %364, ptr %21, align 4, !tbaa !23
  %365 = load i32, ptr %21, align 4, !tbaa !23
  %366 = icmp ne i32 %365, 0
  %367 = xor i1 %366, true
  %368 = xor i1 %367, true
  %369 = zext i1 %368 to i32
  %370 = sext i32 %369 to i64
  %371 = call i64 @llvm.expect.i64(i64 %370, i64 0)
  %372 = icmp ne i64 %371, 0
  br i1 %372, label %373, label %375

373:                                              ; preds = %360
  %374 = load i32, ptr %21, align 4, !tbaa !23
  store i32 %374, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %433

375:                                              ; preds = %360
  store i8 1, ptr %9, align 1, !tbaa !9
  %376 = load i32, ptr %20, align 4, !tbaa !23
  %377 = zext i32 %376 to i64
  %378 = load ptr, ptr %5, align 8, !tbaa !5
  %379 = getelementptr inbounds %struct.MDBX_env, ptr %378, i32 0, i32 7
  %380 = load ptr, ptr %379, align 8, !tbaa !29
  %381 = getelementptr inbounds %struct.shared_lck, ptr %380, i32 0, i32 9
  %382 = getelementptr inbounds %struct.pgops, ptr %381, i32 0, i32 7
  %383 = load volatile i64, ptr %382, align 8, !tbaa !28
  %384 = add i64 %383, %377
  store volatile i64 %384, ptr %382, align 8, !tbaa !28
  %385 = load ptr, ptr %5, align 8, !tbaa !5
  %386 = getelementptr inbounds %struct.MDBX_env, ptr %385, i32 0, i32 24
  %387 = load ptr, ptr %386, align 8, !tbaa !26
  %388 = getelementptr inbounds %struct.MDBX_txn, ptr %387, i32 0, i32 17
  %389 = getelementptr inbounds %struct.anon.10, ptr %388, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #11
  %390 = load ptr, ptr %5, align 8, !tbaa !5
  call void @meta_tap(ptr dead_on_unwind writable sret(%struct.troika) align 8 %24, ptr noundef %390)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %389, ptr align 8 %24, i64 32, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #11
  br label %391

391:                                              ; preds = %375
  %392 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !44
  %393 = zext i8 %392 to i32
  %394 = and i32 %393, 1
  %395 = icmp ne i32 %394, 0
  %396 = xor i1 %395, true
  %397 = xor i1 %396, true
  %398 = zext i1 %397 to i32
  %399 = sext i32 %398 to i64
  %400 = call i64 @llvm.expect.i64(i64 %399, i64 1)
  %401 = icmp ne i64 %400, 0
  br i1 %401, label %402, label %430

402:                                              ; preds = %391
  br label %403

403:                                              ; preds = %402
  %404 = load ptr, ptr %5, align 8, !tbaa !5
  %405 = getelementptr inbounds %struct.MDBX_env, ptr %404, i32 0, i32 39
  %406 = load ptr, ptr %405, align 8, !tbaa !46
  %407 = icmp ne ptr %406, null
  br i1 %407, label %416, label %408

408:                                              ; preds = %403
  %409 = load ptr, ptr %5, align 8, !tbaa !5
  %410 = getelementptr inbounds %struct.MDBX_env, ptr %409, i32 0, i32 24
  %411 = load ptr, ptr %410, align 8, !tbaa !26
  %412 = getelementptr inbounds %struct.MDBX_txn, ptr %411, i32 0, i32 5
  %413 = load ptr, ptr %412, align 8, !tbaa !47
  %414 = icmp ne ptr %413, null
  %415 = xor i1 %414, true
  br label %416

416:                                              ; preds = %408, %403
  %417 = phi i1 [ false, %403 ], [ %415, %408 ]
  %418 = xor i1 %417, true
  %419 = xor i1 %418, true
  %420 = xor i1 %419, true
  %421 = zext i1 %420 to i32
  %422 = sext i32 %421 to i64
  %423 = call i64 @llvm.expect.i64(i64 %422, i64 0)
  %424 = icmp ne i64 %423, 0
  br i1 %424, label %425, label %427

425:                                              ; preds = %416
  %426 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %426, ptr noundef @.str.11, ptr noundef @__func__.env_sync, i32 noundef 162) #13
  unreachable

427:                                              ; preds = %416
  br label %428

428:                                              ; preds = %427
  br label %429

429:                                              ; preds = %428
  br label %430

430:                                              ; preds = %429, %391
  br label %431

431:                                              ; preds = %430
  br label %432

432:                                              ; preds = %431
  store i32 2, ptr %16, align 4
  br label %433

433:                                              ; preds = %432, %373, %357, %310
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #11
  %434 = load i32, ptr %16, align 4
  switch i32 %434, label %678 [
    i32 2, label %43
  ]

435:                                              ; preds = %249
  br label %436

436:                                              ; preds = %435
  %437 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !44
  %438 = zext i8 %437 to i32
  %439 = and i32 %438, 1
  %440 = icmp ne i32 %439, 0
  %441 = xor i1 %440, true
  %442 = xor i1 %441, true
  %443 = zext i1 %442 to i32
  %444 = sext i32 %443 to i64
  %445 = call i64 @llvm.expect.i64(i64 %444, i64 1)
  %446 = icmp ne i64 %445, 0
  br i1 %446, label %447, label %466

447:                                              ; preds = %436
  br label %448

448:                                              ; preds = %447
  %449 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 0
  %450 = load i64, ptr %449, align 8, !tbaa !31
  %451 = load ptr, ptr %5, align 8, !tbaa !5
  %452 = call i64 @recent_committed_txnid(ptr noundef %451)
  %453 = icmp eq i64 %450, %452
  %454 = xor i1 %453, true
  %455 = xor i1 %454, true
  %456 = xor i1 %455, true
  %457 = zext i1 %456 to i32
  %458 = sext i32 %457 to i64
  %459 = call i64 @llvm.expect.i64(i64 %458, i64 0)
  %460 = icmp ne i64 %459, 0
  br i1 %460, label %461, label %463

461:                                              ; preds = %448
  %462 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %462, ptr noundef @.str.12, ptr noundef @__func__.env_sync, i32 noundef 165) #13
  unreachable

463:                                              ; preds = %448
  br label %464

464:                                              ; preds = %463
  br label %465

465:                                              ; preds = %464
  br label %466

466:                                              ; preds = %465, %436
  br label %467

467:                                              ; preds = %466
  br label %468

468:                                              ; preds = %467
  %469 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 0
  %470 = load i64, ptr %469, align 8, !tbaa !31
  %471 = load ptr, ptr %5, align 8, !tbaa !5
  %472 = getelementptr inbounds %struct.MDBX_env, ptr %471, i32 0, i32 24
  %473 = load ptr, ptr %472, align 8, !tbaa !26
  %474 = getelementptr inbounds %struct.MDBX_txn, ptr %473, i32 0, i32 7
  store i64 %470, ptr %474, align 8, !tbaa !49
  %475 = load ptr, ptr %5, align 8, !tbaa !5
  %476 = getelementptr inbounds %struct.MDBX_env, ptr %475, i32 0, i32 24
  %477 = load ptr, ptr %476, align 8, !tbaa !26
  %478 = call zeroext i1 @txn_gc_detent(ptr noundef %477)
  %479 = load i32, ptr %11, align 4, !tbaa !23
  %480 = or i32 %479, 1073741824
  store i32 %480, ptr %11, align 4, !tbaa !23
  br label %481

481:                                              ; preds = %468, %246
  br label %482

482:                                              ; preds = %481
  %483 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !44
  %484 = zext i8 %483 to i32
  %485 = and i32 %484, 1
  %486 = icmp ne i32 %485, 0
  %487 = xor i1 %486, true
  %488 = xor i1 %487, true
  %489 = zext i1 %488 to i32
  %490 = sext i32 %489 to i64
  %491 = call i64 @llvm.expect.i64(i64 %490, i64 1)
  %492 = icmp ne i64 %491, 0
  br i1 %492, label %493, label %514

493:                                              ; preds = %482
  br label %494

494:                                              ; preds = %493
  %495 = load ptr, ptr %8, align 8, !tbaa !5
  %496 = icmp ne ptr %495, null
  br i1 %496, label %500, label %497

497:                                              ; preds = %494
  %498 = load i8, ptr %9, align 1, !tbaa !9, !range !24, !noundef !25
  %499 = trunc i8 %498 to i1
  br label %500

500:                                              ; preds = %497, %494
  %501 = phi i1 [ true, %494 ], [ %499, %497 ]
  %502 = xor i1 %501, true
  %503 = xor i1 %502, true
  %504 = xor i1 %503, true
  %505 = zext i1 %504 to i32
  %506 = sext i32 %505 to i64
  %507 = call i64 @llvm.expect.i64(i64 %506, i64 0)
  %508 = icmp ne i64 %507, 0
  br i1 %508, label %509, label %511

509:                                              ; preds = %500
  %510 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %510, ptr noundef @.str.13, ptr noundef @__func__.env_sync, i32 noundef 171) #13
  unreachable

511:                                              ; preds = %500
  br label %512

512:                                              ; preds = %511
  br label %513

513:                                              ; preds = %512
  br label %514

514:                                              ; preds = %513, %482
  br label %515

515:                                              ; preds = %514
  br label %516

516:                                              ; preds = %515
  br label %517

517:                                              ; preds = %516
  %518 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !44
  %519 = zext i8 %518 to i32
  %520 = and i32 %519, 1
  %521 = icmp ne i32 %520, 0
  %522 = xor i1 %521, true
  %523 = xor i1 %522, true
  %524 = zext i1 %523 to i32
  %525 = sext i32 %524 to i64
  %526 = call i64 @llvm.expect.i64(i64 %525, i64 1)
  %527 = icmp ne i64 %526, 0
  br i1 %527, label %528, label %550

528:                                              ; preds = %517
  br label %529

529:                                              ; preds = %528
  %530 = load ptr, ptr %8, align 8, !tbaa !5
  %531 = icmp ne ptr %530, null
  br i1 %531, label %532, label %536

532:                                              ; preds = %529
  %533 = load i32, ptr %11, align 4, !tbaa !23
  %534 = and i32 %533, 1073741824
  %535 = icmp eq i32 %534, 0
  br label %536

536:                                              ; preds = %532, %529
  %537 = phi i1 [ true, %529 ], [ %535, %532 ]
  %538 = xor i1 %537, true
  %539 = xor i1 %538, true
  %540 = xor i1 %539, true
  %541 = zext i1 %540 to i32
  %542 = sext i32 %541 to i64
  %543 = call i64 @llvm.expect.i64(i64 %542, i64 0)
  %544 = icmp ne i64 %543, 0
  br i1 %544, label %545, label %547

545:                                              ; preds = %536
  %546 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %546, ptr noundef @.str.14, ptr noundef @__func__.env_sync, i32 noundef 172) #13
  unreachable

547:                                              ; preds = %536
  br label %548

548:                                              ; preds = %547
  br label %549

549:                                              ; preds = %548
  br label %550

550:                                              ; preds = %549, %517
  br label %551

551:                                              ; preds = %550
  br label %552

552:                                              ; preds = %551
  %553 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 2
  %554 = load i64, ptr %553, align 8, !tbaa !33
  %555 = icmp ne i64 %554, 0
  br i1 %555, label %599, label %556

556:                                              ; preds = %552
  %557 = load ptr, ptr %5, align 8, !tbaa !5
  %558 = getelementptr inbounds %struct.MDBX_env, ptr %557, i32 0, i32 16
  %559 = load i8, ptr %558, align 1, !tbaa !35
  %560 = sext i8 %559 to i32
  %561 = icmp sge i32 %560, 0
  %562 = xor i1 %561, true
  %563 = xor i1 %562, true
  %564 = zext i1 %563 to i32
  %565 = sext i32 %564 to i64
  %566 = call i64 @llvm.expect.i64(i64 %565, i64 0)
  %567 = icmp ne i64 %566, 0
  br i1 %567, label %568, label %599

568:                                              ; preds = %556
  %569 = getelementptr inbounds %struct.troika, ptr %12, i32 0, i32 1
  %570 = load i8, ptr %569, align 1, !tbaa !36
  %571 = zext i8 %570 to i32
  %572 = load ptr, ptr %5, align 8, !tbaa !5
  %573 = getelementptr inbounds %struct.MDBX_env, ptr %572, i32 0, i32 16
  %574 = load i8, ptr %573, align 1, !tbaa !35
  %575 = zext i8 %574 to i32
  %576 = icmp ne i32 %571, %575
  br i1 %576, label %577, label %599

577:                                              ; preds = %568
  br label %578

578:                                              ; preds = %577
  %579 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 5), align 2, !tbaa !38
  %580 = zext i8 %579 to i32
  %581 = icmp sle i32 3, %580
  %582 = xor i1 %581, true
  %583 = xor i1 %582, true
  %584 = zext i1 %583 to i32
  %585 = sext i32 %584 to i64
  %586 = call i64 @llvm.expect.i64(i64 %585, i64 0)
  %587 = icmp ne i64 %586, 0
  br i1 %587, label %588, label %596

588:                                              ; preds = %578
  %589 = load ptr, ptr %5, align 8, !tbaa !5
  %590 = getelementptr inbounds %struct.MDBX_env, ptr %589, i32 0, i32 16
  %591 = load i8, ptr %590, align 1, !tbaa !35
  %592 = sext i8 %591 to i32
  %593 = getelementptr inbounds %struct.troika, ptr %12, i32 0, i32 1
  %594 = load i8, ptr %593, align 1, !tbaa !36
  %595 = zext i8 %594 to i32
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 3, ptr noundef @__func__.env_sync, i32 noundef 177, ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef %592, i32 noundef %595)
  br label %596

596:                                              ; preds = %588, %578
  br label %597

597:                                              ; preds = %596
  br label %598

598:                                              ; preds = %597
  store i32 -1, ptr %10, align 4, !tbaa !23
  br label %671

599:                                              ; preds = %568, %556, %552
  %600 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 2
  %601 = load i64, ptr %600, align 8, !tbaa !33
  %602 = icmp ne i64 %601, 0
  br i1 %602, label %603, label %610

603:                                              ; preds = %599
  %604 = load i32, ptr %11, align 4, !tbaa !23
  %605 = and i32 %604, 65536
  %606 = icmp eq i32 %605, 0
  br i1 %606, label %607, label %657

607:                                              ; preds = %603
  %608 = load i64, ptr %14, align 8, !tbaa !30
  %609 = icmp ne i64 %608, 0
  br i1 %609, label %610, label %657

610:                                              ; preds = %607, %599
  br label %611

611:                                              ; preds = %610
  %612 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 5), align 2, !tbaa !38
  %613 = zext i8 %612 to i32
  %614 = icmp sle i32 5, %613
  %615 = xor i1 %614, true
  %616 = xor i1 %615, true
  %617 = zext i1 %616 to i32
  %618 = sext i32 %617 to i64
  %619 = call i64 @llvm.expect.i64(i64 %618, i64 0)
  %620 = icmp ne i64 %619, 0
  br i1 %620, label %621, label %631

621:                                              ; preds = %611
  %622 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 1
  %623 = load ptr, ptr %622, align 8, !tbaa !28
  %624 = call ptr @data_page(ptr noundef %623) #12
  %625 = getelementptr inbounds %struct.page, ptr %624, i32 0, i32 4
  %626 = load i32, ptr %625, align 1, !tbaa !23
  %627 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 1
  %628 = load ptr, ptr %627, align 8, !tbaa !28
  %629 = call ptr @durable_caption(ptr noundef %628)
  %630 = load i64, ptr %14, align 8, !tbaa !30
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 5, ptr noundef @__func__.env_sync, i32 noundef 183, ptr noundef @.str.15, i32 noundef %626, ptr noundef %629, i64 noundef %630)
  br label %631

631:                                              ; preds = %621, %611
  br label %632

632:                                              ; preds = %631
  br label %633

633:                                              ; preds = %632
  call void @llvm.lifetime.start.p0(i64 224, ptr %25) #11
  %634 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 1
  %635 = load ptr, ptr %634, align 8, !tbaa !28
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %635, i64 224, i1 false), !tbaa.struct !50
  %636 = load ptr, ptr %5, align 8, !tbaa !5
  %637 = load i32, ptr %11, align 4, !tbaa !23
  %638 = load ptr, ptr %5, align 8, !tbaa !5
  %639 = getelementptr inbounds %struct.MDBX_env, ptr %638, i32 0, i32 24
  %640 = load ptr, ptr %639, align 8, !tbaa !26
  %641 = getelementptr inbounds %struct.MDBX_txn, ptr %640, i32 0, i32 17
  %642 = getelementptr inbounds %struct.anon.10, ptr %641, i32 0, i32 0
  %643 = call i32 @dxb_sync_locked(ptr noundef %636, i32 noundef %637, ptr noundef %25, ptr noundef %642)
  store i32 %643, ptr %10, align 4, !tbaa !23
  %644 = load i32, ptr %10, align 4, !tbaa !23
  %645 = icmp ne i32 %644, 0
  %646 = xor i1 %645, true
  %647 = xor i1 %646, true
  %648 = zext i1 %647 to i32
  %649 = sext i32 %648 to i64
  %650 = call i64 @llvm.expect.i64(i64 %649, i64 0)
  %651 = icmp ne i64 %650, 0
  br i1 %651, label %652, label %653

652:                                              ; preds = %633
  store i32 3, ptr %16, align 4
  br label %654

653:                                              ; preds = %633
  store i32 0, ptr %16, align 4
  br label %654

654:                                              ; preds = %653, %652
  call void @llvm.lifetime.end.p0(i64 224, ptr %25) #11
  %655 = load i32, ptr %16, align 4
  switch i32 %655, label %678 [
    i32 0, label %656
    i32 3, label %671
  ]

656:                                              ; preds = %654
  br label %657

657:                                              ; preds = %656, %607, %603
  %658 = load ptr, ptr %5, align 8, !tbaa !5
  %659 = getelementptr inbounds %struct.MDBX_env, ptr %658, i32 0, i32 7
  %660 = load ptr, ptr %659, align 8, !tbaa !29
  %661 = getelementptr inbounds %struct.shared_lck, ptr %660, i32 0, i32 4
  %662 = call i32 @atomic_load32(ptr noundef %661, i32 noundef 0)
  %663 = getelementptr inbounds %struct.meta_ptr, ptr %13, i32 0, i32 0
  %664 = load i64, ptr %663, align 8, !tbaa !31
  %665 = trunc i64 %664 to i32
  %666 = icmp ne i32 %662, %665
  br i1 %666, label %667, label %670

667:                                              ; preds = %657
  %668 = load ptr, ptr %5, align 8, !tbaa !5
  %669 = call i32 @meta_sync(ptr noundef %668, ptr noundef byval(%struct.meta_ptr) align 8 %13)
  store i32 %669, ptr %10, align 4, !tbaa !23
  br label %670

670:                                              ; preds = %667, %657
  br label %671

671:                                              ; preds = %670, %654, %598, %203, %103, %57
  %672 = load i8, ptr %9, align 1, !tbaa !9, !range !24, !noundef !25
  %673 = trunc i8 %672 to i1
  br i1 %673, label %674, label %676

674:                                              ; preds = %671
  %675 = load ptr, ptr %5, align 8, !tbaa !5
  call void @lck_txn_unlock(ptr noundef %675)
  br label %676

676:                                              ; preds = %674, %671
  %677 = load i32, ptr %10, align 4, !tbaa !23
  store i32 %677, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %678

678:                                              ; preds = %676, %654, %433, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #11
  br label %679

679:                                              ; preds = %678, %39
  %680 = load i32, ptr %4, align 4
  ret i32 %680
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

declare void @meta_tap(ptr dead_on_unwind writable sret(%struct.troika) align 8, ptr noundef) #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @meta_recent(ptr dead_on_unwind noalias writable sret(%struct.meta_ptr) align 8, ptr noundef, ptr noundef) #8

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @atomic_load64(ptr noundef, i32 noundef) #9

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @atomic_load32(ptr noundef, i32 noundef) #9

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

declare i32 @dxb_resize(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #7

declare i64 @osal_monotime() #7

declare i32 @osal_fastmutex_acquire(ptr noundef) #7

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

declare i32 @osal_msync(ptr noundef, i64 noundef, i64 noundef, i32 noundef) #7

declare i32 @osal_fastmutex_release(ptr noundef) #7

declare i32 @osal_fsync(i32 noundef, i32 noundef) #7

declare i32 @lck_txn_lock(ptr noundef, i1 noundef zeroext) #7

declare i64 @recent_committed_txnid(ptr noundef) #7

declare zeroext i1 @txn_gc_detent(ptr noundef) #7

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare hidden ptr @data_page(ptr noundef) #4

declare ptr @durable_caption(ptr noundef) #7

declare i32 @dxb_sync_locked(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #7

declare i32 @meta_sync(ptr noundef, ptr noundef byval(%struct.meta_ptr) align 8) #7

declare void @lck_txn_unlock(ptr noundef) #7

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"MDBX_env", !7, i64 0, !13, i64 4, !13, i64 8, !14, i64 16, !13, i64 56, !13, i64 60, !14, i64 64, !6, i64 104, !16, i64 112, !16, i64 114, !16, i64 116, !16, i64 118, !16, i64 120, !16, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !16, i64 130, !13, i64 132, !13, i64 136, !13, i64 140, !13, i64 144, !17, i64 152, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !13, i64 224, !13, i64 228, !13, i64 232, !6, i64 240, !6, i64 248, !15, i64 256, !18, i64 264, !20, i64 320, !10, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !21, i64 392, !7, i64 400, !13, i64 440, !13, i64 444, !6, i64 448, !22, i64 456, !7, i64 496, !7, i64 536}
!13 = !{!"int", !7, i64 0}
!14 = !{!"osal_mmap", !7, i64 0, !13, i64 8, !15, i64 16, !15, i64 24, !15, i64 32}
!15 = !{!"long", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !15, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !13, i64 28, !13, i64 32, !10, i64 36, !10, i64 37, !10, i64 38, !19, i64 40, !7, i64 48}
!19 = !{!"", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6}
!20 = !{!"", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32}
!21 = !{!"", !15, i64 0}
!22 = !{!"osal_ioring", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!13, !13, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!12, !6, i64 192}
!27 = !{i64 0, i64 1, !28, i64 1, i64 1, !28, i64 2, i64 1, !28, i64 3, i64 1, !28, i64 4, i64 4, !23, i64 8, i64 24, !28}
!28 = !{!7, !7, i64 0}
!29 = !{!12, !6, i64 104}
!30 = !{!15, !15, i64 0}
!31 = !{!32, !15, i64 0}
!32 = !{!"meta_ptr", !15, i64 0, !7, i64 8, !15, i64 16}
!33 = !{!32, !15, i64 16}
!34 = !{!12, !15, i64 40}
!35 = !{!12, !7, i64 129}
!36 = !{!37, !7, i64 1}
!37 = !{!"troika", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !13, i64 4, !7, i64 8}
!38 = !{!39, !7, i64 26}
!39 = !{!"libmdbx_globals", !7, i64 0, !13, i64 16, !13, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !10, i64 27, !13, i64 28, !7, i64 32, !7, i64 40, !15, i64 80, !6, i64 88}
!40 = !{!41, !13, i64 28}
!41 = !{!"meta", !7, i64 0, !7, i64 8, !16, i64 16, !7, i64 18, !7, i64 19, !42, i64 20, !7, i64 40, !43, i64 136, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 208}
!42 = !{!"geo", !16, i64 0, !16, i64 2, !13, i64 4, !13, i64 8, !7, i64 12, !7, i64 16}
!43 = !{!"MDBX_canary", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!44 = !{!39, !7, i64 25}
!45 = !{!12, !13, i64 24}
!46 = !{!12, !6, i64 384}
!47 = !{!48, !6, i64 32}
!48 = !{!"MDBX_txn", !13, i64 0, !13, i64 4, !15, i64 8, !15, i64 16, !6, i64 24, !6, i64 32, !42, i64 40, !15, i64 64, !15, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !43, i64 128, !6, i64 160, !7, i64 168}
!49 = !{!48, !15, i64 64}
!50 = !{i64 0, i64 8, !28, i64 8, i64 8, !28, i64 16, i64 2, !51, i64 18, i64 1, !28, i64 19, i64 1, !28, i64 20, i64 2, !51, i64 22, i64 2, !51, i64 24, i64 4, !23, i64 28, i64 4, !23, i64 32, i64 4, !28, i64 36, i64 4, !28, i64 40, i64 96, !28, i64 136, i64 8, !30, i64 144, i64 8, !30, i64 152, i64 8, !30, i64 160, i64 8, !30, i64 168, i64 8, !28, i64 176, i64 8, !28, i64 184, i64 8, !28, i64 192, i64 16, !28, i64 208, i64 16, !28}
!51 = !{!16, !16, 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.14 }
%struct.anon.14 = 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.troika = type { i8, i8, i8, i8, i32, [3 x i64] }
%struct.meta_ptr = type { i64, %union.anon.16, i64 }
%union.anon.16 = type { ptr }
%struct.meta = type { [2 x i32], %union.anon.20, i16, i8, i8, %struct.geo, %union.anon.21, %struct.MDBX_canary, %union.anon.24, [2 x %union.mdbx_atomic_uint32_t], [2 x i32], %union.bin128, %union.bin128 }
%union.anon.20 = type { i64 }
%struct.geo = type { i16, i16, i32, i32, %union.anon.6, %union.anon.7 }
%union.anon.6 = type { i32 }
%union.anon.7 = type { i32 }
%union.anon.21 = type { %struct.anon.22 }
%struct.anon.22 = type { %struct.tree, %struct.tree }
%struct.tree = type { i16, i16, i32, i32, i32, i32, i32, i64, i64, i64 }
%struct.MDBX_canary = type { i64, i64, i64, i64 }
%union.anon.24 = type { i64 }
%union.mdbx_atomic_uint32_t = type { i32 }

@globals = external local_unnamed_addr global %struct.libmdbx_globals, align 8
@__func__.env_sync = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @env_owned_wrtxn(ptr noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: cold nounwind optsize uwtable
define dso_local i32 @env_sync(ptr noundef %0, i1 noundef zeroext %1, i1 noundef zeroext %2) local_unnamed_addr #4 {
  %4 = alloca %struct.troika, align 8
  %5 = alloca %struct.meta_ptr, align 8
  %6 = alloca %struct.troika, align 8
  %7 = alloca %struct.meta, align 4
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = and i32 %9, 131072
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %.thread165, !prof !21

11:                                               ; preds = %3
  %12 = tail call ptr @env_owned_wrtxn(ptr noundef nonnull %0)
  %13 = load i32, ptr %8, align 4, !tbaa !5
  %14 = and i32 %13, -1610612736
  %.not126223 = icmp eq i32 %14, 536870912
  br i1 %.not126223, label %.lr.ph, label %._crit_edge.thread, !prof !22

._crit_edge.thread:                               ; preds = %11
  %.not156262 = icmp sgt i32 %13, -1
  %15 = select i1 %.not156262, i32 1, i32 -30795
  br label %.thread165

.lr.ph:                                           ; preds = %11
  %16 = icmp ne ptr %12, null
  %17 = getelementptr inbounds i8, ptr %0, i64 192
  %18 = getelementptr inbounds i8, ptr %0, i64 104
  %19 = getelementptr inbounds i8, ptr %5, i64 16
  %20 = getelementptr inbounds i8, ptr %5, i64 8
  %21 = getelementptr inbounds i8, ptr %0, i64 40
  %22 = getelementptr inbounds i8, ptr %0, i64 129
  %23 = getelementptr inbounds i8, ptr %4, i64 1
  %24 = getelementptr inbounds i8, ptr %0, i64 496
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  %27 = getelementptr inbounds i8, ptr %0, i64 384
  br label %29

._crit_edge:                                      ; preds = %146
  %.not156 = icmp sgt i32 %147, -1
  %28 = select i1 %.not156, i32 1, i32 -30795
  br i1 %.not126223, label %.loopexit.thread, label %.thread165

29:                                               ; preds = %.lr.ph, %146
  %30 = phi i32 [ %13, %.lr.ph ], [ %147, %146 ]
  %.099225 = phi i1 [ false, %.lr.ph ], [ true, %146 ]
  %.0104224 = phi i32 [ -1, %.lr.ph ], [ %.2106, %146 ]
  %31 = and i32 %30, -1074003969
  %brmerge = or i1 %16, %.099225
  br i1 %brmerge, label %32, label %35

32:                                               ; preds = %29
  %33 = load ptr, ptr %17, align 8, !tbaa !23
  %34 = getelementptr inbounds i8, ptr %33, i64 168
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %34, i64 32, i1 false), !tbaa.struct !24
  br label %36

35:                                               ; preds = %29
  call void @meta_tap(ptr dead_on_unwind nonnull writable sret(%struct.troika) align 8 %4, ptr noundef nonnull %0) #10
  br label %36

36:                                               ; preds = %35, %32
  call void @meta_recent(ptr dead_on_unwind nonnull writable sret(%struct.meta_ptr) align 8 %5, ptr noundef nonnull %0, ptr noundef nonnull %4)
  %37 = load ptr, ptr %18, align 8, !tbaa !27
  %38 = getelementptr inbounds i8, ptr %37, i64 376
  %39 = call i64 @atomic_load64(ptr noundef nonnull %38, i32 noundef 0)
  %40 = icmp eq i64 %39, 0
  br i1 %40, label %41, label %50

41:                                               ; preds = %36
  %42 = load ptr, ptr %18, align 8, !tbaa !27
  %43 = getelementptr inbounds i8, ptr %42, i64 20
  %44 = call i32 @atomic_load32(ptr noundef nonnull %43, i32 noundef 0)
  %45 = load i64, ptr %5, align 8, !tbaa !28
  %46 = trunc i64 %45 to i32
  %47 = icmp eq i32 %44, %46
  %48 = load i64, ptr %19, align 8
  %49 = icmp ne i64 %48, 0
  %or.cond = select i1 %47, i1 %49, i1 false
  br i1 %or.cond, label %.loopexit, label %50

50:                                               ; preds = %41, %36
  br i1 %.099225, label %51, label %78

51:                                               ; preds = %50
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = and i32 %52, 524288
  %.not127 = icmp eq i32 %53, 0
  br i1 %.not127, label %78, label %54

54:                                               ; preds = %51
  %55 = load ptr, ptr %20, align 8, !tbaa !25
  %56 = getelementptr inbounds i8, ptr %55, i64 36
  %57 = load i32, ptr %56, align 4, !tbaa !25
  %58 = load i64, ptr %21, align 8, !tbaa !30
  %59 = call i32 @bytes2pgno(ptr noundef nonnull %0, i64 noundef %58) #11
  %60 = icmp ugt i32 %57, %59
  br i1 %60, label %61, label %78, !prof !31

61:                                               ; preds = %54
  %62 = load i8, ptr %22, align 1, !tbaa !32
  %63 = sext i8 %62 to i32
  %64 = icmp sgt i8 %62, -1
  br i1 %64, label %65, label %72, !prof !31

65:                                               ; preds = %61
  %66 = load i8, ptr %23, align 1, !tbaa !33
  %67 = zext i8 %66 to i32
  %.not128 = icmp eq i8 %66, %62
  br i1 %.not128, label %72, label %68

68:                                               ; preds = %65
  %69 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !35
  %70 = icmp ugt i8 %69, 2
  br i1 %70, label %71, label %78, !prof !31

71:                                               ; preds = %68
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 3, ptr noundef nonnull @__func__.env_sync, i32 noundef 94, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef %63, i32 noundef %67) #10
  br label %78

72:                                               ; preds = %65, %61
  %73 = getelementptr inbounds i8, ptr %55, i64 32
  %74 = load i32, ptr %73, align 4, !tbaa !25
  %75 = getelementptr inbounds i8, ptr %55, i64 28
  %76 = load i32, ptr %75, align 4, !tbaa !37
  %77 = call i32 @dxb_resize(ptr noundef nonnull %0, i32 noundef %57, i32 noundef %74, i32 noundef %76, i32 noundef 0) #10
  %.not129 = icmp eq i32 %77, 0
  br i1 %.not129, label %78, label %.loopexit.thread, !prof !21

78:                                               ; preds = %68, %71, %72, %54, %51, %50
  %.1105 = phi i32 [ 0, %72 ], [ %.0104224, %54 ], [ %.0104224, %51 ], [ %.0104224, %50 ], [ -1, %71 ], [ -1, %68 ]
  %79 = load ptr, ptr %18, align 8, !tbaa !27
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  %81 = call i32 @atomic_load32(ptr noundef nonnull %80, i32 noundef 0)
  %82 = load ptr, ptr %18, align 8, !tbaa !27
  %83 = getelementptr inbounds i8, ptr %82, i64 24
  %84 = call i64 @atomic_load64(ptr noundef nonnull %83, i32 noundef 0)
  br i1 %1, label %95, label %85

85:                                               ; preds = %78
  %86 = zext i32 %81 to i64
  %.not130 = icmp eq i32 %81, 0
  %.not131 = icmp ult i64 %39, %86
  %or.cond157 = or i1 %.not130, %.not131
  br i1 %or.cond157, label %87, label %95

87:                                               ; preds = %85
  %.not132 = icmp eq i64 %84, 0
  br i1 %.not132, label %97, label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %18, align 8, !tbaa !27
  %90 = getelementptr inbounds i8, ptr %89, i64 368
  %91 = call i64 @atomic_load64(ptr noundef nonnull %90, i32 noundef 0)
  %.not133 = icmp eq i64 %91, 0
  br i1 %.not133, label %97, label %92

92:                                               ; preds = %88
  %93 = call i64 @osal_monotime() #10
  %94 = sub i64 %93, %91
  %.not134 = icmp ult i64 %94, %84
  br i1 %.not134, label %97, label %95

95:                                               ; preds = %85, %92, %78
  %96 = and i32 %30, 524288
  br label %97

97:                                               ; preds = %95, %92, %88, %87
  %.0108 = phi i32 [ %96, %95 ], [ %31, %92 ], [ %31, %88 ], [ %31, %87 ]
  br i1 %16, label %.loopexit172, label %98

98:                                               ; preds = %97
  br i1 %.099225, label %149, label %99

99:                                               ; preds = %98
  %100 = icmp ugt i64 %39, 42
  %101 = and i32 %.0108, 65536
  %102 = icmp eq i32 %101, 0
  %or.cond159 = and i1 %100, %102
  br i1 %or.cond159, label %103, label %129

103:                                              ; preds = %99
  %104 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !41
  %105 = and i8 %104, 1
  %.not135 = icmp eq i8 %105, 0
  br i1 %.not135, label %111, label %106, !prof !31

106:                                              ; preds = %103
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = xor i32 %107, %.0108
  %109 = and i32 %108, 524288
  %.not136 = icmp eq i32 %109, 0
  br i1 %.not136, label %111, label %110, !prof !21

110:                                              ; preds = %106
  call void @mdbx_assert_fail(ptr noundef nonnull %0, ptr noundef nonnull @.str.10, ptr noundef nonnull @__func__.env_sync, i32 noundef 121) #12
  unreachable

111:                                              ; preds = %106, %103
  %112 = and i32 %.0108, 524288
  %.not137 = icmp eq i32 %112, 0
  br i1 %.not137, label %125, label %113

113:                                              ; preds = %111
  %114 = call i32 @osal_fastmutex_acquire(ptr noundef nonnull %24) #10
  %.not138 = icmp eq i32 %114, 0
  br i1 %.not138, label %115, label %.thread165, !prof !21

115:                                              ; preds = %113
  %116 = load ptr, ptr %20, align 8, !tbaa !25
  %117 = getelementptr inbounds i8, ptr %116, i64 36
  %118 = load i32, ptr %117, align 4, !tbaa !25
  %119 = zext i32 %118 to i64
  %120 = call i64 @pgno_align2os_bytes(ptr noundef nonnull %0, i64 noundef %119) #11
  %121 = call i32 @osal_msync(ptr noundef nonnull %25, i64 noundef 0, i64 noundef %120, i32 noundef 2) #10
  %122 = call i32 @osal_fastmutex_release(ptr noundef nonnull %24) #10
  %.not139 = icmp eq i32 %122, 0
  br i1 %.not139, label %128, label %123, !prof !21

123:                                              ; preds = %115
  %124 = icmp eq i32 %121, 0
  %spec.select = select i1 %124, i32 %122, i32 %121
  br label %.thread165

125:                                              ; preds = %111
  %126 = load i32, ptr %26, align 8, !tbaa !42
  %127 = call i32 @osal_fsync(i32 noundef %126, i32 noundef 2) #10
  br label %128

128:                                              ; preds = %115, %125
  %.1102 = phi i32 [ %127, %125 ], [ %121, %115 ]
  %.not140 = icmp eq i32 %.1102, 0
  br i1 %.not140, label %129, label %.thread165, !prof !43

129:                                              ; preds = %128, %99
  %.2106 = phi i32 [ %.1105, %99 ], [ 0, %128 ]
  %.0103 = phi i64 [ 0, %99 ], [ 1, %128 ]
  %130 = call i32 @lck_txn_lock(ptr noundef nonnull %0, i1 noundef zeroext %2) #10
  %.not141 = icmp eq i32 %130, 0
  br i1 %.not141, label %131, label %.thread165, !prof !21

131:                                              ; preds = %129
  %132 = load ptr, ptr %18, align 8, !tbaa !27
  %133 = getelementptr inbounds i8, ptr %132, i64 120
  %134 = load volatile i64, ptr %133, align 8, !tbaa !25
  %135 = add i64 %134, %.0103
  store volatile i64 %135, ptr %133, align 8, !tbaa !25
  %136 = load ptr, ptr %17, align 8, !tbaa !23
  %137 = getelementptr inbounds i8, ptr %136, i64 168
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #10
  call void @meta_tap(ptr dead_on_unwind nonnull writable sret(%struct.troika) align 8 %6, ptr noundef nonnull %0) #10
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %137, ptr noundef nonnull align 8 dereferenceable(32) %6, i64 32, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #10
  %138 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !41
  %139 = and i8 %138, 1
  %.not142 = icmp eq i8 %139, 0
  br i1 %.not142, label %146, label %140, !prof !31

140:                                              ; preds = %131
  %141 = load ptr, ptr %27, align 8, !tbaa !44
  %.not143 = icmp eq ptr %141, null
  br i1 %.not143, label %142, label %.critedge, !prof !21

142:                                              ; preds = %140
  %143 = load ptr, ptr %17, align 8, !tbaa !23
  %144 = getelementptr inbounds i8, ptr %143, i64 32
  %145 = load ptr, ptr %144, align 8, !tbaa !45
  %.not144 = icmp eq ptr %145, null
  br i1 %.not144, label %146, label %.critedge, !prof !21

.critedge:                                        ; preds = %140, %142
  call void @mdbx_assert_fail(ptr noundef nonnull %0, ptr noundef nonnull @.str.11, ptr noundef nonnull @__func__.env_sync, i32 noundef 162) #12
  unreachable

146:                                              ; preds = %131, %142
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = and i32 %147, -1610612736
  %.not126 = icmp eq i32 %148, 536870912
  br i1 %.not126, label %29, label %._crit_edge, !prof !47

149:                                              ; preds = %98
  %150 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !41
  %151 = and i8 %150, 1
  %.not145 = icmp eq i8 %151, 0
  br i1 %.not145, label %156, label %152, !prof !31

152:                                              ; preds = %149
  %153 = load i64, ptr %5, align 8, !tbaa !28
  %154 = call i64 @recent_committed_txnid(ptr noundef nonnull %0) #10
  %.not146 = icmp eq i64 %153, %154
  br i1 %.not146, label %156, label %155, !prof !21

155:                                              ; preds = %152
  call void @mdbx_assert_fail(ptr noundef nonnull %0, ptr noundef nonnull @.str.12, ptr noundef nonnull @__func__.env_sync, i32 noundef 165) #12
  unreachable

156:                                              ; preds = %152, %149
  %157 = load i64, ptr %5, align 8, !tbaa !28
  %158 = load ptr, ptr %17, align 8, !tbaa !23
  %159 = getelementptr inbounds i8, ptr %158, i64 64
  store i64 %157, ptr %159, align 8, !tbaa !48
  %160 = call zeroext i1 @txn_gc_detent(ptr noundef %158) #10
  %161 = or disjoint i32 %.0108, 1073741824
  br label %.loopexit172

.loopexit172:                                     ; preds = %97, %156
  %.1109 = phi i32 [ %161, %156 ], [ %.0108, %97 ]
  %.099225235 = xor i1 %16, true
  %162 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !41
  %163 = and i8 %162, 1
  %.not147 = icmp eq i8 %163, 0
  br i1 %.not147, label %168, label %164, !prof !31

164:                                              ; preds = %.loopexit172
  %165 = and i32 %.1109, 1073741824
  %166 = icmp ne i32 %165, 0
  %.not150 = select i1 %16, i1 %166, i1 false
  br i1 %.not150, label %167, label %168, !prof !31

167:                                              ; preds = %164
  call void @mdbx_assert_fail(ptr noundef nonnull %0, ptr noundef nonnull @.str.14, ptr noundef nonnull @__func__.env_sync, i32 noundef 172) #12
  unreachable

168:                                              ; preds = %164, %.loopexit172
  %169 = load i64, ptr %19, align 8, !tbaa !49
  %.not151 = icmp eq i64 %169, 0
  br i1 %.not151, label %170, label %181

170:                                              ; preds = %168
  %171 = load i8, ptr %22, align 1, !tbaa !32
  %172 = sext i8 %171 to i32
  %173 = icmp sgt i8 %171, -1
  br i1 %173, label %174, label %.thread171, !prof !31

174:                                              ; preds = %170
  %175 = load i8, ptr %23, align 1, !tbaa !33
  %176 = zext i8 %175 to i32
  %.not152 = icmp eq i8 %175, %171
  br i1 %.not152, label %.thread171, label %177

177:                                              ; preds = %174
  %178 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !35
  %179 = icmp ugt i8 %178, 2
  br i1 %179, label %180, label %.loopexit, !prof !31

180:                                              ; preds = %177
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 3, ptr noundef nonnull @__func__.env_sync, i32 noundef 177, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef %172, i32 noundef %176) #10
  br i1 %16, label %.thread165, label %.loopexit.thread

181:                                              ; preds = %168
  %182 = and i32 %.1109, 65536
  %183 = icmp eq i32 %182, 0
  %184 = icmp ne i64 %39, 0
  %or.cond4 = and i1 %184, %183
  br i1 %or.cond4, label %.thread171, label %198

.thread171:                                       ; preds = %170, %174, %181
  %185 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !35
  %186 = icmp ugt i8 %185, 4
  br i1 %186, label %187, label %193, !prof !31

187:                                              ; preds = %.thread171
  %188 = load ptr, ptr %20, align 8, !tbaa !25
  %189 = call ptr @data_page(ptr noundef %188) #11
  %190 = getelementptr inbounds i8, ptr %189, i64 16
  %191 = load i32, ptr %190, align 1, !tbaa !26
  %192 = call ptr @durable_caption(ptr noundef %188) #10
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 5, ptr noundef nonnull @__func__.env_sync, i32 noundef 183, ptr noundef nonnull @.str.15, i32 noundef %191, ptr noundef %192, i64 noundef %39) #10
  br label %193

193:                                              ; preds = %187, %.thread171
  call void @llvm.lifetime.start.p0(i64 224, ptr nonnull %7) #10
  %194 = load ptr, ptr %20, align 8, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(224) %7, ptr noundef nonnull align 4 dereferenceable(224) %194, i64 224, i1 false), !tbaa.struct !50
  %195 = load ptr, ptr %17, align 8, !tbaa !23
  %196 = getelementptr inbounds i8, ptr %195, i64 168
  %197 = call i32 @dxb_sync_locked(ptr noundef nonnull %0, i32 noundef %.1109, ptr noundef nonnull %7, ptr noundef nonnull %196) #10
  %.not154 = icmp eq i32 %197, 0
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %7) #10
  br i1 %.not154, label %198, label %.loopexit

198:                                              ; preds = %193, %181
  %.4 = phi i32 [ 0, %193 ], [ %.1105, %181 ]
  %199 = load ptr, ptr %18, align 8, !tbaa !27
  %200 = getelementptr inbounds i8, ptr %199, i64 20
  %201 = call i32 @atomic_load32(ptr noundef nonnull %200, i32 noundef 0)
  %202 = load i64, ptr %5, align 8, !tbaa !28
  %203 = trunc i64 %202 to i32
  %.not155 = icmp eq i32 %201, %203
  br i1 %.not155, label %.loopexit, label %204

204:                                              ; preds = %198
  %205 = call i32 @meta_sync(ptr noundef nonnull %0, ptr noundef nonnull byval(%struct.meta_ptr) align 8 %5) #10
  br i1 %16, label %.thread165, label %.loopexit.thread

.loopexit:                                        ; preds = %41, %193, %177, %198
  %.099189 = phi i1 [ %.099225235, %193 ], [ %.099225235, %198 ], [ %.099225235, %177 ], [ %.099225, %41 ]
  %.5 = phi i32 [ %197, %193 ], [ %.4, %198 ], [ -1, %177 ], [ %.0104224, %41 ]
  br i1 %.099189, label %.loopexit.thread, label %.thread165

.loopexit.thread:                                 ; preds = %72, %180, %204, %._crit_edge, %.loopexit
  %.5260 = phi i32 [ %.5, %.loopexit ], [ %28, %._crit_edge ], [ %205, %204 ], [ -1, %180 ], [ %77, %72 ]
  call void @lck_txn_unlock(ptr noundef nonnull %0) #10
  br label %.thread165

.thread165:                                       ; preds = %129, %128, %113, %._crit_edge.thread, %180, %204, %._crit_edge, %123, %.loopexit.thread, %.loopexit, %3
  %.3 = phi i32 [ 13, %3 ], [ %.5260, %.loopexit.thread ], [ %.5, %.loopexit ], [ %spec.select, %123 ], [ %28, %._crit_edge ], [ %205, %204 ], [ -1, %180 ], [ %15, %._crit_edge.thread ], [ %114, %113 ], [ %.1102, %128 ], [ %130, %129 ]
  ret i32 %.3
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

declare void @meta_tap(ptr dead_on_unwind writable sret(%struct.troika) align 8, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @meta_recent(ptr dead_on_unwind noalias writable sret(%struct.meta_ptr) align 8, ptr noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @atomic_load64(ptr noundef, i32 noundef) local_unnamed_addr #8

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @atomic_load32(ptr noundef, i32 noundef) local_unnamed_addr #8

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

declare i32 @dxb_resize(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

declare i64 @osal_monotime() local_unnamed_addr #6

declare i32 @osal_fastmutex_acquire(ptr noundef) local_unnamed_addr #6

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

declare i32 @osal_msync(ptr noundef, i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #6

declare i32 @osal_fastmutex_release(ptr noundef) local_unnamed_addr #6

declare i32 @osal_fsync(i32 noundef, i32 noundef) local_unnamed_addr #6

declare i32 @lck_txn_lock(ptr noundef, i1 noundef zeroext) local_unnamed_addr #6

declare i64 @recent_committed_txnid(ptr noundef) local_unnamed_addr #6

declare zeroext i1 @txn_gc_detent(ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare hidden ptr @data_page(ptr noundef) local_unnamed_addr #3

declare ptr @durable_caption(ptr noundef) local_unnamed_addr #6

declare i32 @dxb_sync_locked(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @meta_sync(ptr noundef, ptr noundef byval(%struct.meta_ptr) align 8) local_unnamed_addr #6

declare void @lck_txn_unlock(ptr noundef) local_unnamed_addr #6

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

!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, !9, i64 4}
!6 = !{!"MDBX_env", !7, i64 0, !9, i64 4, !9, i64 8, !10, i64 16, !9, i64 56, !9, i64 60, !10, i64 64, !12, i64 104, !13, i64 112, !13, i64 114, !13, i64 116, !13, i64 118, !13, i64 120, !13, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !13, i64 130, !9, i64 132, !9, i64 136, !9, i64 140, !9, i64 144, !14, 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, !15, i64 264, !18, i64 320, !16, i64 360, !12, i64 368, !12, i64 376, !12, i64 384, !19, i64 392, !7, i64 400, !9, i64 440, !9, i64 444, !12, i64 448, !20, i64 456, !7, i64 496, !7, i64 536}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"osal_mmap", !7, i64 0, !9, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!11 = !{!"long", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!15 = !{!"", !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, !16, i64 36, !16, i64 37, !16, i64 38, !17, i64 40, !7, i64 48}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6}
!18 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!19 = !{!"", !11, i64 0}
!20 = !{!"osal_ioring", !9, i64 0, !9, i64 4, !9, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!21 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!22 = !{!"branch_weights", i32 127, i32 1}
!23 = !{!6, !12, i64 192}
!24 = !{i64 0, i64 1, !25, i64 1, i64 1, !25, i64 2, i64 1, !25, i64 3, i64 1, !25, i64 4, i64 4, !26, i64 8, i64 24, !25}
!25 = !{!7, !7, i64 0}
!26 = !{!9, !9, i64 0}
!27 = !{!6, !12, i64 104}
!28 = !{!29, !11, i64 0}
!29 = !{!"meta_ptr", !11, i64 0, !7, i64 8, !11, i64 16}
!30 = !{!6, !11, i64 40}
!31 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!32 = !{!6, !7, i64 129}
!33 = !{!34, !7, i64 1}
!34 = !{!"troika", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !9, i64 4, !7, i64 8}
!35 = !{!36, !7, i64 26}
!36 = !{!"libmdbx_globals", !7, i64 0, !9, i64 16, !9, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !16, i64 27, !9, i64 28, !7, i64 32, !7, i64 40, !11, i64 80, !12, i64 88}
!37 = !{!38, !9, i64 28}
!38 = !{!"meta", !7, i64 0, !7, i64 8, !13, i64 16, !7, i64 18, !7, i64 19, !39, i64 20, !7, i64 40, !40, i64 136, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 208}
!39 = !{!"geo", !13, i64 0, !13, i64 2, !9, i64 4, !9, i64 8, !7, i64 12, !7, i64 16}
!40 = !{!"MDBX_canary", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!41 = !{!36, !7, i64 25}
!42 = !{!6, !9, i64 24}
!43 = !{!"branch_weights", !"expected", i32 2146946777, i32 536871}
!44 = !{!6, !12, i64 384}
!45 = !{!46, !12, i64 32}
!46 = !{!"MDBX_txn", !9, i64 0, !9, i64 4, !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 32, !39, 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, !40, i64 128, !12, i64 160, !7, i64 168}
!47 = !{!"branch_weights", i32 255873, i32 127}
!48 = !{!46, !11, i64 64}
!49 = !{!29, !11, i64 16}
!50 = !{i64 0, i64 8, !25, i64 8, i64 8, !25, i64 16, i64 2, !51, i64 18, i64 1, !25, i64 19, i64 1, !25, i64 20, i64 2, !51, i64 22, i64 2, !51, i64 24, i64 4, !26, i64 28, i64 4, !26, i64 32, i64 4, !25, i64 36, i64 4, !25, i64 40, i64 96, !25, i64 136, i64 8, !52, i64 144, i64 8, !52, i64 152, i64 8, !52, i64 160, i64 8, !52, i64 168, i64 8, !25, i64 176, i64 8, !25, i64 184, i64 8, !25, i64 192, i64 16, !25, i64 208, i64 16, !25}
!51 = !{!13, !13, i64 0}
!52 = !{!11, !11, i64 0}


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