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

; 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.17 }
%struct.anon.17 = 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_txn = type { i32, i32, i64, i64, ptr, ptr, %struct.geo, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, %struct.MDBX_canary, ptr, %union.anon.1 }
%struct.geo = type { i16, i16, i32, i32, %union.anon, %union.anon.0 }
%union.anon = type { i32 }
%union.anon.0 = type { i32 }
%struct.MDBX_canary = type { i64, i64, i64, i64 }
%union.anon.1 = type { %struct.anon.2 }
%struct.anon.2 = type { %struct.troika, ptr, %struct.anon.3, i8, i32, i32, i64, ptr, ptr, ptr, i64, %union.anon.4 }
%struct.troika = type { i8, i8, i8, i8, i32, [3 x i64] }
%struct.anon.3 = type { %struct.MDBX_rkl, i64, %struct.MDBX_rkl }
%struct.MDBX_rkl = type { i64, i64, i32, i32, ptr, [12 x i64] }
%union.anon.4 = type { %struct.anon.5 }
%struct.anon.5 = type { i64, ptr }
%struct.iov_ctx = type { ptr, ptr, i32, i32, i32, i32, i64 }
%struct.page = type <{ i64, i16, i16, %union.anon.19, i32, [0 x i16] }>
%union.anon.19 = type { i32 }

@globals = external global %struct.libmdbx_globals, align 8
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@__func__.iov_page = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @iov_write(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @iov_empty(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
declare hidden void @iov_complete(ptr noundef) #1

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

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

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

27:                                               ; preds = %16
  br label %28

28:                                               ; preds = %27
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.iov_ctx, ptr %29, i32 0, i32 3
  %31 = load i32, ptr %30, align 4, !tbaa !20
  %32 = icmp eq i32 %31, 0
  %33 = xor i1 %32, true
  %34 = xor i1 %33, true
  %35 = xor i1 %34, true
  %36 = zext i1 %35 to i32
  %37 = sext i32 %36 to i64
  %38 = call i64 @llvm.expect.i64(i64 %37, i64 0)
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %44

40:                                               ; preds = %28
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.MDBX_txn, ptr %41, i32 0, i32 9
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %43, ptr noundef @.str.2, ptr noundef @__func__.iov_page, i32 noundef 143) #8
  unreachable

44:                                               ; preds = %28
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46, %16
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  br label %50

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

61:                                               ; preds = %50
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.page, ptr %63, i32 0, i32 4
  %65 = load i32, ptr %64, align 1, !tbaa !22
  %66 = icmp uge i32 %65, 3
  br i1 %66, label %67, label %76

67:                                               ; preds = %62
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.page, ptr %68, i32 0, i32 4
  %70 = load i32, ptr %69, align 1, !tbaa !22
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.MDBX_txn, ptr %71, i32 0, i32 6
  %73 = getelementptr inbounds %struct.geo, ptr %72, i32 0, i32 5
  %74 = load i32, ptr %73, align 8, !tbaa !23
  %75 = icmp ult i32 %70, %74
  br label %76

76:                                               ; preds = %67, %62
  %77 = phi i1 [ false, %62 ], [ %75, %67 ]
  %78 = xor i1 %77, true
  %79 = xor i1 %78, true
  %80 = xor i1 %79, true
  %81 = zext i1 %80 to i32
  %82 = sext i32 %81 to i64
  %83 = call i64 @llvm.expect.i64(i64 %82, i64 0)
  %84 = icmp ne i64 %83, 0
  br i1 %84, label %85, label %89

85:                                               ; preds = %76
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.MDBX_txn, ptr %86, i32 0, i32 9
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %88, ptr noundef @.str.3, ptr noundef @__func__.iov_page, i32 noundef 144) #8
  unreachable

89:                                               ; preds = %76
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91, %50
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  br label %95

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

106:                                              ; preds = %95
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = call zeroext i1 @is_modifable(ptr noundef %108, ptr noundef %109) #9
  %111 = xor i1 %110, true
  %112 = xor i1 %111, true
  %113 = xor i1 %112, true
  %114 = zext i1 %113 to i32
  %115 = sext i32 %114 to i64
  %116 = call i64 @llvm.expect.i64(i64 %115, i64 0)
  %117 = icmp ne i64 %116, 0
  br i1 %117, label %118, label %122

118:                                              ; preds = %107
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.MDBX_txn, ptr %119, i32 0, i32 9
  %121 = load ptr, ptr %120, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %121, ptr noundef @.str.4, ptr noundef @__func__.iov_page, i32 noundef 145) #8
  unreachable

122:                                              ; preds = %107
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124, %95
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !17
  %130 = zext i8 %129 to i32
  %131 = and i32 %130, 1
  %132 = icmp ne i32 %131, 0
  %133 = xor i1 %132, true
  %134 = xor i1 %133, true
  %135 = zext i1 %134 to i32
  %136 = sext i32 %135 to i64
  %137 = call i64 @llvm.expect.i64(i64 %136, i64 1)
  %138 = icmp ne i64 %137, 0
  br i1 %138, label %139, label %162

139:                                              ; preds = %128
  br label %140

140:                                              ; preds = %139
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.page, ptr %141, i32 0, i32 2
  %143 = load i16, ptr %142, align 1, !tbaa !24
  %144 = zext i16 %143 to i32
  %145 = and i32 %144, -40
  %146 = icmp ne i32 %145, 0
  %147 = xor i1 %146, true
  %148 = xor i1 %147, true
  %149 = xor i1 %148, true
  %150 = xor i1 %149, true
  %151 = zext i1 %150 to i32
  %152 = sext i32 %151 to i64
  %153 = call i64 @llvm.expect.i64(i64 %152, i64 0)
  %154 = icmp ne i64 %153, 0
  br i1 %154, label %155, label %159

155:                                              ; preds = %140
  %156 = load ptr, ptr %6, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.MDBX_txn, ptr %156, i32 0, i32 9
  %158 = load ptr, ptr %157, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %158, ptr noundef @.str.5, ptr noundef @__func__.iov_page, i32 noundef 146) #8
  unreachable

159:                                              ; preds = %140
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161, %128
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  %167 = call zeroext i1 @is_shadowed(ptr noundef %165, ptr noundef %166) #9
  br i1 %167, label %168, label %391

168:                                              ; preds = %164
  br label %169

169:                                              ; preds = %168
  %170 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !17
  %171 = zext i8 %170 to i32
  %172 = and i32 %171, 1
  %173 = icmp ne i32 %172, 0
  %174 = xor i1 %173, true
  %175 = xor i1 %174, true
  %176 = zext i1 %175 to i32
  %177 = sext i32 %176 to i64
  %178 = call i64 @llvm.expect.i64(i64 %177, i64 1)
  %179 = icmp ne i64 %178, 0
  br i1 %179, label %180, label %202

180:                                              ; preds = %169
  br label %181

181:                                              ; preds = %180
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.MDBX_txn, ptr %182, i32 0, i32 1
  %184 = load i32, ptr %183, align 4, !tbaa !25
  %185 = and i32 %184, 524288
  %186 = icmp ne i32 %185, 0
  %187 = xor i1 %186, true
  %188 = xor i1 %187, true
  %189 = xor i1 %188, true
  %190 = xor i1 %189, true
  %191 = zext i1 %190 to i32
  %192 = sext i32 %191 to i64
  %193 = call i64 @llvm.expect.i64(i64 %192, i64 0)
  %194 = icmp ne i64 %193, 0
  br i1 %194, label %195, label %199

195:                                              ; preds = %181
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.MDBX_txn, ptr %196, i32 0, i32 9
  %198 = load ptr, ptr %197, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %198, ptr noundef @.str.6, ptr noundef @__func__.iov_page, i32 noundef 149) #8
  unreachable

199:                                              ; preds = %181
  br label %200

200:                                              ; preds = %199
  br label %201

201:                                              ; preds = %200
  br label %202

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

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.MDBX_txn, ptr %205, i32 0, i32 7
  %207 = load i64, ptr %206, align 8, !tbaa !26
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.page, ptr %208, i32 0, i32 0
  store i64 %207, ptr %209, align 1, !tbaa !9
  br label %210

210:                                              ; preds = %204
  %211 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !17
  %212 = zext i8 %211 to i32
  %213 = and i32 %212, 1
  %214 = icmp ne i32 %213, 0
  %215 = xor i1 %214, true
  %216 = xor i1 %215, true
  %217 = zext i1 %216 to i32
  %218 = sext i32 %217 to i64
  %219 = call i64 @llvm.expect.i64(i64 %218, i64 1)
  %220 = icmp ne i64 %219, 0
  br i1 %220, label %221, label %240

221:                                              ; preds = %210
  br label %222

222:                                              ; preds = %221
  %223 = load ptr, ptr %6, align 8, !tbaa !5
  %224 = load ptr, ptr %8, align 8, !tbaa !5
  %225 = call zeroext i1 @is_spilled(ptr noundef %223, ptr noundef %224) #9
  %226 = xor i1 %225, true
  %227 = xor i1 %226, true
  %228 = xor i1 %227, true
  %229 = zext i1 %228 to i32
  %230 = sext i32 %229 to i64
  %231 = call i64 @llvm.expect.i64(i64 %230, i64 0)
  %232 = icmp ne i64 %231, 0
  br i1 %232, label %233, label %237

233:                                              ; preds = %222
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.MDBX_txn, ptr %234, i32 0, i32 9
  %236 = load ptr, ptr %235, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %236, ptr noundef @.str.7, ptr noundef @__func__.iov_page, i32 noundef 151) #8
  unreachable

237:                                              ; preds = %222
  br label %238

238:                                              ; preds = %237
  br label %239

239:                                              ; preds = %238
  br label %240

240:                                              ; preds = %239, %210
  br label %241

241:                                              ; preds = %240
  br label %242

242:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %243 = load ptr, ptr %7, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.iov_ctx, ptr %243, i32 0, i32 1
  %245 = load ptr, ptr %244, align 8, !tbaa !27
  %246 = load ptr, ptr %10, align 8, !tbaa !5
  %247 = load ptr, ptr %8, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.page, ptr %247, i32 0, i32 4
  %249 = load i32, ptr %248, align 1, !tbaa !22
  %250 = zext i32 %249 to i64
  %251 = call i64 @pgno2bytes(ptr noundef %246, i64 noundef %250) #9
  %252 = load ptr, ptr %8, align 8, !tbaa !5
  %253 = load ptr, ptr %10, align 8, !tbaa !5
  %254 = load i64, ptr %9, align 8, !tbaa !9
  %255 = call i64 @pgno2bytes(ptr noundef %253, i64 noundef %254) #9
  %256 = call i32 @osal_ioring_add(ptr noundef %245, i64 noundef %251, ptr noundef %252, i64 noundef %255)
  store i32 %256, ptr %11, align 4, !tbaa !22
  %257 = load i32, ptr %11, align 4, !tbaa !22
  %258 = icmp ne i32 %257, 0
  %259 = xor i1 %258, true
  %260 = xor i1 %259, true
  %261 = zext i1 %260 to i32
  %262 = sext i32 %261 to i64
  %263 = call i64 @llvm.expect.i64(i64 %262, i64 0)
  %264 = icmp ne i64 %263, 0
  br i1 %264, label %265, label %387

265:                                              ; preds = %242
  %266 = load i32, ptr %11, align 4, !tbaa !22
  %267 = load ptr, ptr %7, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.iov_ctx, ptr %267, i32 0, i32 3
  store i32 %266, ptr %268, align 4, !tbaa !20
  %269 = load i32, ptr %11, align 4, !tbaa !22
  %270 = icmp ne i32 %269, -1
  %271 = xor i1 %270, true
  %272 = xor i1 %271, true
  %273 = zext i1 %272 to i32
  %274 = sext i32 %273 to i64
  %275 = call i64 @llvm.expect.i64(i64 %274, i64 0)
  %276 = icmp ne i64 %275, 0
  br i1 %276, label %277, label %280

277:                                              ; preds = %265
  %278 = load ptr, ptr %7, align 8, !tbaa !5
  call void @iov_complete(ptr noundef %278)
  %279 = load i32, ptr %11, align 4, !tbaa !22
  store i32 %279, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %388

280:                                              ; preds = %265
  %281 = load ptr, ptr %7, align 8, !tbaa !5
  %282 = call i32 @iov_write(ptr noundef %281)
  store i32 %282, ptr %11, align 4, !tbaa !22
  br label %283

283:                                              ; preds = %280
  %284 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !17
  %285 = zext i8 %284 to i32
  %286 = and i32 %285, 1
  %287 = icmp ne i32 %286, 0
  %288 = xor i1 %287, true
  %289 = xor i1 %288, true
  %290 = zext i1 %289 to i32
  %291 = sext i32 %290 to i64
  %292 = call i64 @llvm.expect.i64(i64 %291, i64 1)
  %293 = icmp ne i64 %292, 0
  br i1 %293, label %294, label %312

294:                                              ; preds = %283
  br label %295

295:                                              ; preds = %294
  %296 = load ptr, ptr %7, align 8, !tbaa !5
  %297 = call zeroext i1 @iov_empty(ptr noundef %296)
  %298 = xor i1 %297, true
  %299 = xor i1 %298, true
  %300 = xor i1 %299, true
  %301 = zext i1 %300 to i32
  %302 = sext i32 %301 to i64
  %303 = call i64 @llvm.expect.i64(i64 %302, i64 0)
  %304 = icmp ne i64 %303, 0
  br i1 %304, label %305, label %309

305:                                              ; preds = %295
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.MDBX_txn, ptr %306, i32 0, i32 9
  %308 = load ptr, ptr %307, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %308, ptr noundef @.str.8, ptr noundef @__func__.iov_page, i32 noundef 163) #8
  unreachable

309:                                              ; preds = %295
  br label %310

310:                                              ; preds = %309
  br label %311

311:                                              ; preds = %310
  br label %312

312:                                              ; preds = %311, %283
  br label %313

313:                                              ; preds = %312
  br label %314

314:                                              ; preds = %313
  %315 = load i32, ptr %11, align 4, !tbaa !22
  %316 = icmp eq i32 %315, 0
  %317 = xor i1 %316, true
  %318 = xor i1 %317, true
  %319 = zext i1 %318 to i32
  %320 = sext i32 %319 to i64
  %321 = call i64 @llvm.expect.i64(i64 %320, i64 1)
  %322 = icmp ne i64 %321, 0
  br i1 %322, label %323, label %352

323:                                              ; preds = %314
  %324 = load ptr, ptr %7, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.iov_ctx, ptr %324, i32 0, i32 1
  %326 = load ptr, ptr %325, align 8, !tbaa !27
  %327 = load ptr, ptr %10, align 8, !tbaa !5
  %328 = load ptr, ptr %8, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.page, ptr %328, i32 0, i32 4
  %330 = load i32, ptr %329, align 1, !tbaa !22
  %331 = zext i32 %330 to i64
  %332 = call i64 @pgno2bytes(ptr noundef %327, i64 noundef %331) #9
  %333 = load ptr, ptr %8, align 8, !tbaa !5
  %334 = load ptr, ptr %10, align 8, !tbaa !5
  %335 = load i64, ptr %9, align 8, !tbaa !9
  %336 = call i64 @pgno2bytes(ptr noundef %334, i64 noundef %335) #9
  %337 = call i32 @osal_ioring_add(ptr noundef %326, i64 noundef %332, ptr noundef %333, i64 noundef %336)
  store i32 %337, ptr %11, align 4, !tbaa !22
  %338 = load i32, ptr %11, align 4, !tbaa !22
  %339 = icmp ne i32 %338, 0
  %340 = xor i1 %339, true
  %341 = xor i1 %340, true
  %342 = zext i1 %341 to i32
  %343 = sext i32 %342 to i64
  %344 = call i64 @llvm.expect.i64(i64 %343, i64 0)
  %345 = icmp ne i64 %344, 0
  br i1 %345, label %346, label %351

346:                                              ; preds = %323
  %347 = load ptr, ptr %7, align 8, !tbaa !5
  call void @iov_complete(ptr noundef %347)
  %348 = load i32, ptr %11, align 4, !tbaa !22
  %349 = load ptr, ptr %7, align 8, !tbaa !5
  %350 = getelementptr inbounds %struct.iov_ctx, ptr %349, i32 0, i32 3
  store i32 %348, ptr %350, align 4, !tbaa !20
  store i32 %348, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %388

351:                                              ; preds = %323
  br label %352

352:                                              ; preds = %351, %314
  br label %353

353:                                              ; preds = %352
  %354 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !17
  %355 = zext i8 %354 to i32
  %356 = and i32 %355, 1
  %357 = icmp ne i32 %356, 0
  %358 = xor i1 %357, true
  %359 = xor i1 %358, true
  %360 = zext i1 %359 to i32
  %361 = sext i32 %360 to i64
  %362 = call i64 @llvm.expect.i64(i64 %361, i64 1)
  %363 = icmp ne i64 %362, 0
  br i1 %363, label %364, label %384

364:                                              ; preds = %353
  br label %365

365:                                              ; preds = %364
  %366 = load ptr, ptr %7, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct.iov_ctx, ptr %366, i32 0, i32 3
  %368 = load i32, ptr %367, align 4, !tbaa !20
  %369 = icmp eq i32 %368, 0
  %370 = xor i1 %369, true
  %371 = xor i1 %370, true
  %372 = xor i1 %371, true
  %373 = zext i1 %372 to i32
  %374 = sext i32 %373 to i64
  %375 = call i64 @llvm.expect.i64(i64 %374, i64 0)
  %376 = icmp ne i64 %375, 0
  br i1 %376, label %377, label %381

377:                                              ; preds = %365
  %378 = load ptr, ptr %6, align 8, !tbaa !5
  %379 = getelementptr inbounds %struct.MDBX_txn, ptr %378, i32 0, i32 9
  %380 = load ptr, ptr %379, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %380, ptr noundef @.str.2, ptr noundef @__func__.iov_page, i32 noundef 171) #8
  unreachable

381:                                              ; preds = %365
  br label %382

382:                                              ; preds = %381
  br label %383

383:                                              ; preds = %382
  br label %384

384:                                              ; preds = %383, %353
  br label %385

385:                                              ; preds = %384
  br label %386

386:                                              ; preds = %385
  br label %387

387:                                              ; preds = %386, %242
  store i32 0, ptr %12, align 4
  br label %388

388:                                              ; preds = %387, %346, %277
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %389 = load i32, ptr %12, align 4
  switch i32 %389, label %472 [
    i32 0, label %390
  ]

390:                                              ; preds = %388
  br label %427

391:                                              ; preds = %164
  br label %392

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

403:                                              ; preds = %392
  br label %404

404:                                              ; preds = %403
  %405 = load ptr, ptr %6, align 8, !tbaa !5
  %406 = getelementptr inbounds %struct.MDBX_txn, ptr %405, i32 0, i32 1
  %407 = load i32, ptr %406, align 4, !tbaa !25
  %408 = and i32 %407, 524288
  %409 = icmp ne i32 %408, 0
  %410 = xor i1 %409, true
  %411 = xor i1 %410, true
  %412 = xor i1 %411, true
  %413 = zext i1 %412 to i32
  %414 = sext i32 %413 to i64
  %415 = call i64 @llvm.expect.i64(i64 %414, i64 0)
  %416 = icmp ne i64 %415, 0
  br i1 %416, label %417, label %421

417:                                              ; preds = %404
  %418 = load ptr, ptr %6, align 8, !tbaa !5
  %419 = getelementptr inbounds %struct.MDBX_txn, ptr %418, i32 0, i32 9
  %420 = load ptr, ptr %419, align 8, !tbaa !11
  call void @mdbx_assert_fail(ptr noundef %420, ptr noundef @.str.9, ptr noundef @__func__.iov_page, i32 noundef 174) #8
  unreachable

421:                                              ; preds = %404
  br label %422

422:                                              ; preds = %421
  br label %423

423:                                              ; preds = %422
  br label %424

424:                                              ; preds = %423, %392
  br label %425

425:                                              ; preds = %424
  br label %426

426:                                              ; preds = %425
  br label %427

427:                                              ; preds = %426, %390
  %428 = load ptr, ptr %7, align 8, !tbaa !5
  %429 = getelementptr inbounds %struct.iov_ctx, ptr %428, i32 0, i32 4
  %430 = load i32, ptr %429, align 8, !tbaa !28
  %431 = load ptr, ptr %8, align 8, !tbaa !5
  %432 = getelementptr inbounds %struct.page, ptr %431, i32 0, i32 4
  %433 = load i32, ptr %432, align 1, !tbaa !22
  %434 = icmp ult i32 %430, %433
  br i1 %434, label %435, label %439

435:                                              ; preds = %427
  %436 = load ptr, ptr %7, align 8, !tbaa !5
  %437 = getelementptr inbounds %struct.iov_ctx, ptr %436, i32 0, i32 4
  %438 = load i32, ptr %437, align 8, !tbaa !28
  br label %443

439:                                              ; preds = %427
  %440 = load ptr, ptr %8, align 8, !tbaa !5
  %441 = getelementptr inbounds %struct.page, ptr %440, i32 0, i32 4
  %442 = load i32, ptr %441, align 1, !tbaa !22
  br label %443

443:                                              ; preds = %439, %435
  %444 = phi i32 [ %438, %435 ], [ %442, %439 ]
  %445 = load ptr, ptr %7, align 8, !tbaa !5
  %446 = getelementptr inbounds %struct.iov_ctx, ptr %445, i32 0, i32 4
  store i32 %444, ptr %446, align 8, !tbaa !28
  %447 = load ptr, ptr %7, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.iov_ctx, ptr %447, i32 0, i32 5
  %449 = load i32, ptr %448, align 4, !tbaa !29
  %450 = load ptr, ptr %8, align 8, !tbaa !5
  %451 = getelementptr inbounds %struct.page, ptr %450, i32 0, i32 4
  %452 = load i32, ptr %451, align 1, !tbaa !22
  %453 = load i64, ptr %9, align 8, !tbaa !9
  %454 = trunc i64 %453 to i32
  %455 = add i32 %452, %454
  %456 = icmp ugt i32 %449, %455
  br i1 %456, label %457, label %461

457:                                              ; preds = %443
  %458 = load ptr, ptr %7, align 8, !tbaa !5
  %459 = getelementptr inbounds %struct.iov_ctx, ptr %458, i32 0, i32 5
  %460 = load i32, ptr %459, align 4, !tbaa !29
  br label %468

461:                                              ; preds = %443
  %462 = load ptr, ptr %8, align 8, !tbaa !5
  %463 = getelementptr inbounds %struct.page, ptr %462, i32 0, i32 4
  %464 = load i32, ptr %463, align 1, !tbaa !22
  %465 = load i64, ptr %9, align 8, !tbaa !9
  %466 = trunc i64 %465 to i32
  %467 = add i32 %464, %466
  br label %468

468:                                              ; preds = %461, %457
  %469 = phi i32 [ %460, %457 ], [ %467, %461 ]
  %470 = load ptr, ptr %7, align 8, !tbaa !5
  %471 = getelementptr inbounds %struct.iov_ctx, ptr %470, i32 0, i32 5
  store i32 %469, ptr %471, align 4, !tbaa !29
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %472

472:                                              ; preds = %468, %388
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %473 = load i32, ptr %5, align 4
  ret i32 %473
}

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

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

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

declare i32 @osal_ioring_add(ptr noundef, i64 noundef, ptr noundef, i64 noundef) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 80}
!12 = !{!"MDBX_txn", !13, i64 0, !13, i64 4, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !14, i64 40, !10, i64 64, !10, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !16, i64 128, !6, i64 160, !7, i64 168}
!13 = !{!"int", !7, i64 0}
!14 = !{!"geo", !15, i64 0, !15, i64 2, !13, i64 4, !13, i64 8, !7, i64 12, !7, i64 16}
!15 = !{!"short", !7, i64 0}
!16 = !{!"MDBX_canary", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!17 = !{!18, !7, i64 25}
!18 = !{!"libmdbx_globals", !7, i64 0, !13, i64 16, !13, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !19, i64 27, !13, i64 28, !7, i64 32, !7, i64 40, !10, i64 80, !6, i64 88}
!19 = !{!"_Bool", !7, i64 0}
!20 = !{!21, !13, i64 20}
!21 = !{!"iov_ctx", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !10, i64 32}
!22 = !{!13, !13, i64 0}
!23 = !{!7, !7, i64 0}
!24 = !{!15, !15, i64 0}
!25 = !{!12, !13, i64 4}
!26 = !{!12, !10, i64 64}
!27 = !{!21, !6, i64 8}
!28 = !{!21, !13, i64 24}
!29 = !{!21, !13, i64 28}


; 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.17 }
%struct.anon.17 = type { i64, i64 }
%union.logger_union = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@globals = external local_unnamed_addr global %struct.libmdbx_globals, align 8
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@__func__.iov_page = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @iov_empty(ptr 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: nounwind uwtable
declare hidden void @iov_complete(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @iov_page(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 80
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !15
  %8 = and i8 %7, 1
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %.thread89, label %9, !prof !18

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %1, i64 20
  %11 = load i32, ptr %10, align 4, !tbaa !19
  %.not72 = icmp eq i32 %11, 0
  br i1 %.not72, label %13, label %12, !prof !21

12:                                               ; preds = %9
  tail call void @mdbx_assert_fail(ptr noundef %6, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.iov_page, i32 noundef 143) #6
  unreachable

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %2, i64 16
  %15 = load i32, ptr %14, align 1, !tbaa !22
  %16 = icmp ugt i32 %15, 2
  br i1 %16, label %17, label %.critedge, !prof !21

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %0, i64 56
  %19 = load i32, ptr %18, align 8, !tbaa !23
  %20 = icmp ult i32 %15, %19
  br i1 %20, label %21, label %.critedge, !prof !21

.critedge:                                        ; preds = %13, %17
  tail call void @mdbx_assert_fail(ptr noundef %6, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.iov_page, i32 noundef 144) #6
  unreachable

21:                                               ; preds = %17
  %22 = tail call zeroext i1 @is_modifable(ptr noundef nonnull %0, ptr noundef nonnull %2) #7
  br i1 %22, label %24, label %23, !prof !21

23:                                               ; preds = %21
  tail call void @mdbx_assert_fail(ptr noundef %6, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.iov_page, i32 noundef 145) #6
  unreachable

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %2, i64 10
  %26 = load i16, ptr %25, align 1, !tbaa !24
  %27 = and i16 %26, -40
  %.not76 = icmp eq i16 %27, 0
  br i1 %.not76, label %.thread90, label %28, !prof !21

28:                                               ; preds = %24
  tail call void @mdbx_assert_fail(ptr noundef %6, ptr noundef nonnull @.str.5, ptr noundef nonnull @__func__.iov_page, i32 noundef 146) #6
  unreachable

.thread89:                                        ; preds = %4
  %29 = tail call zeroext i1 @is_shadowed(ptr noundef nonnull %0, ptr noundef %2) #7
  br i1 %29, label %.thread92, label %.thread93

.thread90:                                        ; preds = %24
  %30 = tail call zeroext i1 @is_shadowed(ptr noundef nonnull %0, ptr noundef nonnull %2) #7
  %31 = getelementptr inbounds i8, ptr %0, i64 4
  %32 = load i32, ptr %31, align 4, !tbaa !25
  %33 = and i32 %32, 524288
  %.not80 = icmp eq i32 %33, 0
  br i1 %30, label %.thread91, label %.thread96

.thread92:                                        ; preds = %.thread89
  %34 = getelementptr inbounds i8, ptr %0, i64 64
  %35 = load i64, ptr %34, align 8, !tbaa !26
  store i64 %35, ptr %2, align 1, !tbaa !27
  %.phi.trans.insert = getelementptr inbounds i8, ptr %2, i64 16
  %.pre = load i32, ptr %.phi.trans.insert, align 1, !tbaa !22
  br label %42

.thread91:                                        ; preds = %.thread90
  br i1 %.not80, label %37, label %36, !prof !21

36:                                               ; preds = %.thread91
  tail call void @mdbx_assert_fail(ptr noundef %6, ptr noundef nonnull @.str.6, ptr noundef nonnull @__func__.iov_page, i32 noundef 149) #6
  unreachable

37:                                               ; preds = %.thread91
  %38 = getelementptr inbounds i8, ptr %0, i64 64
  %39 = load i64, ptr %38, align 8, !tbaa !26
  store i64 %39, ptr %2, align 1, !tbaa !27
  %40 = tail call zeroext i1 @is_spilled(ptr noundef nonnull %0, ptr noundef nonnull %2) #7
  br i1 %40, label %42, label %41, !prof !21

41:                                               ; preds = %37
  tail call void @mdbx_assert_fail(ptr noundef %6, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.iov_page, i32 noundef 151) #6
  unreachable

42:                                               ; preds = %.thread92, %37
  %43 = phi i32 [ %.pre, %.thread92 ], [ %15, %37 ]
  %44 = getelementptr inbounds i8, ptr %1, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !28
  %46 = getelementptr inbounds i8, ptr %2, i64 16
  %47 = zext i32 %43 to i64
  %48 = tail call i64 @pgno2bytes(ptr noundef %6, i64 noundef %47) #7
  %49 = tail call i64 @pgno2bytes(ptr noundef %6, i64 noundef %3) #7
  %50 = tail call i32 @osal_ioring_add(ptr noundef %45, i64 noundef %48, ptr noundef nonnull %2, i64 noundef %49) #8
  %.not82 = icmp eq i32 %50, 0
  br i1 %.not82, label %.thread93, label %51, !prof !21

51:                                               ; preds = %42
  %52 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 %50, ptr %52, align 4, !tbaa !19
  %.not83 = icmp eq i32 %50, -1
  br i1 %.not83, label %54, label %53, !prof !21

53:                                               ; preds = %51
  tail call void @iov_complete(ptr noundef nonnull %1)
  br label %90

54:                                               ; preds = %51
  %55 = tail call i32 @iov_write(ptr noundef nonnull %1)
  %56 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !15
  %57 = and i8 %56, 1
  %.not84 = icmp eq i8 %57, 0
  br i1 %.not84, label %62, label %58, !prof !18

58:                                               ; preds = %54
  %59 = tail call zeroext i1 @iov_empty(ptr noundef nonnull %1)
  br i1 %59, label %62, label %60, !prof !21

60:                                               ; preds = %58
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  tail call void @mdbx_assert_fail(ptr noundef %61, ptr noundef nonnull @.str.8, ptr noundef nonnull @__func__.iov_page, i32 noundef 163) #6
  unreachable

62:                                               ; preds = %58, %54
  %63 = icmp eq i32 %55, 0
  br i1 %63, label %64, label %72, !prof !21

64:                                               ; preds = %62
  %65 = load ptr, ptr %44, align 8, !tbaa !28
  %66 = load i32, ptr %46, align 1, !tbaa !22
  %67 = zext i32 %66 to i64
  %68 = tail call i64 @pgno2bytes(ptr noundef %6, i64 noundef %67) #7
  %69 = tail call i64 @pgno2bytes(ptr noundef %6, i64 noundef %3) #7
  %70 = tail call i32 @osal_ioring_add(ptr noundef %65, i64 noundef %68, ptr noundef nonnull %2, i64 noundef %69) #8
  %.not85 = icmp eq i32 %70, 0
  br i1 %.not85, label %72, label %71, !prof !21

71:                                               ; preds = %64
  tail call void @iov_complete(ptr noundef nonnull %1)
  store i32 %70, ptr %52, align 4, !tbaa !19
  br label %90

72:                                               ; preds = %62, %64
  %73 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !15
  %74 = and i8 %73, 1
  %.not86 = icmp eq i8 %74, 0
  br i1 %.not86, label %.thread93, label %75, !prof !18

75:                                               ; preds = %72
  %76 = load i32, ptr %52, align 4, !tbaa !19
  %.not87 = icmp eq i32 %76, 0
  br i1 %.not87, label %.thread93, label %77, !prof !21

77:                                               ; preds = %75
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  tail call void @mdbx_assert_fail(ptr noundef %78, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.iov_page, i32 noundef 171) #6
  unreachable

.thread96:                                        ; preds = %.thread90
  br i1 %.not80, label %79, label %.thread93, !prof !18

79:                                               ; preds = %.thread96
  tail call void @mdbx_assert_fail(ptr noundef %6, ptr noundef nonnull @.str.9, ptr noundef nonnull @__func__.iov_page, i32 noundef 174) #6
  unreachable

.thread93:                                        ; preds = %.thread89, %42, %75, %72, %.thread96
  %80 = getelementptr inbounds i8, ptr %1, i64 24
  %81 = load i32, ptr %80, align 8, !tbaa !29
  %82 = getelementptr inbounds i8, ptr %2, i64 16
  %83 = load i32, ptr %82, align 1, !tbaa !22
  %. = tail call i32 @llvm.umin.i32(i32 %81, i32 %83)
  store i32 %., ptr %80, align 8, !tbaa !29
  %84 = getelementptr inbounds i8, ptr %1, i64 28
  %85 = load i32, ptr %84, align 4, !tbaa !30
  %86 = load i32, ptr %82, align 1, !tbaa !22
  %87 = trunc i64 %3 to i32
  %88 = add i32 %86, %87
  %89 = tail call i32 @llvm.umax.i32(i32 %85, i32 %88)
  store i32 %89, ptr %84, align 4, !tbaa !30
  br label %90

90:                                               ; preds = %53, %71, %.thread93
  %.1 = phi i32 [ 0, %.thread93 ], [ %50, %53 ], [ %70, %71 ]
  ret i32 %.1
}

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

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

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

declare i32 @osal_ioring_add(ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

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

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

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

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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { noreturn nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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, !11, i64 80}
!6 = !{!"MDBX_txn", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !11, i64 24, !11, i64 32, !12, i64 40, !10, i64 64, !10, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !14, i64 128, !11, i64 160, !8, i64 168}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"geo", !13, i64 0, !13, i64 2, !7, i64 4, !7, i64 8, !8, i64 12, !8, i64 16}
!13 = !{!"short", !8, i64 0}
!14 = !{!"MDBX_canary", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!15 = !{!16, !8, i64 25}
!16 = !{!"libmdbx_globals", !8, i64 0, !7, i64 16, !7, i64 20, !8, i64 24, !8, i64 25, !8, i64 26, !17, i64 27, !7, i64 28, !8, i64 32, !8, i64 40, !10, i64 80, !11, i64 88}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!19 = !{!20, !7, i64 20}
!20 = !{!"iov_ctx", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !10, i64 32}
!21 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!22 = !{!7, !7, i64 0}
!23 = !{!8, !8, i64 0}
!24 = !{!13, !13, i64 0}
!25 = !{!6, !7, i64 4}
!26 = !{!6, !10, i64 64}
!27 = !{!10, !10, i64 0}
!28 = !{!20, !11, i64 8}
!29 = !{!20, !7, i64 24}
!30 = !{!20, !7, i64 28}


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