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

; 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.0 }
%struct.anon.0 = 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_cursor = type { i32, %union.anon, i8, i8, ptr, ptr, ptr, ptr, ptr, [32 x ptr], [32 x i16], ptr, ptr }
%union.anon = type { i16 }
%struct.anon = type { i8, i8 }
%struct.page = type <{ i64, i16, i16, %union.anon.2, i32, [0 x i16] }>
%union.anon.2 = type { i32 }
%struct.iovec = type { ptr, 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.6 }
%struct.geo = type { i16, i16, i32, i32, %union.anon.4, %union.anon.5 }
%union.anon.4 = type { i32 }
%union.anon.5 = type { i32 }
%struct.MDBX_canary = type { i64, i64, i64, i64 }
%union.anon.6 = type { %struct.anon.8 }
%struct.anon.8 = type { %struct.troika, ptr, %struct.anon.9, i8, i32, i32, i64, ptr, ptr, ptr, i64, %union.anon.10 }
%struct.troika = type { i8, i8, i8, i8, i32, [3 x i64] }
%struct.anon.9 = type { %struct.MDBX_rkl, i64, %struct.MDBX_rkl }
%struct.MDBX_rkl = type { i64, i64, i32, i32, ptr, [12 x i64] }
%union.anon.10 = type { %struct.anon.11 }
%struct.anon.11 = type { i64, ptr }
%struct.tree = type { i16, i16, i32, i32, i32, i32, i32, i64, i64, i64 }
%struct.anon.3 = type { i16, i16 }

@globals = external global %struct.libmdbx_globals, align 8
@.str = external hidden unnamed_addr constant [18 x i8], align 1
@__func__.node_add_dupfix = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: hot nounwind uwtable
define dso_local i32 @node_add_dupfix(ptr noundef %0, i64 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [510 x i8], align 16
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.MDBX_cursor, ptr %17, i32 0, i32 9
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.MDBX_cursor, ptr %19, i32 0, i32 1
  %21 = getelementptr inbounds %struct.anon, ptr %20, i32 0, i32 1
  %22 = load i8, ptr %21, align 1, !tbaa !11
  %23 = sext i8 %22 to i64
  %24 = getelementptr inbounds [32 x ptr], ptr %18, i64 0, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %25, ptr %8, align 8, !tbaa !5
  br label %26

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

37:                                               ; preds = %26
  br label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  %41 = xor i1 %40, true
  %42 = xor i1 %41, true
  %43 = xor i1 %42, true
  %44 = zext i1 %43 to i32
  %45 = sext i32 %44 to i64
  %46 = call i64 @llvm.expect.i64(i64 %45, i64 0)
  %47 = icmp ne i64 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %38
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str, ptr noundef @__func__.node_add_dupfix, i32 noundef 10) #8
  unreachable

49:                                               ; preds = %38
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51, %26
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 510, ptr %9) #7
  br label %55

55:                                               ; preds = %54
  %56 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 5), align 2, !tbaa !16
  %57 = zext i8 %56 to i32
  %58 = icmp sle i32 5, %57
  %59 = xor i1 %58, true
  %60 = xor i1 %59, true
  %61 = zext i1 %60 to i32
  %62 = sext i32 %61 to i64
  %63 = call i64 @llvm.expect.i64(i64 %62, i64 0)
  %64 = icmp ne i64 %63, 0
  br i1 %64, label %65, label %86

65:                                               ; preds = %55
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = call zeroext i1 @is_subpage(ptr noundef %66) #9
  %68 = zext i1 %67 to i64
  %69 = select i1 %67, ptr @.str.2, ptr @.str.3
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.page, ptr %70, i32 0, i32 4
  %72 = load i32, ptr %71, align 1, !tbaa !17
  %73 = load i64, ptr %6, align 8, !tbaa !9
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %80

76:                                               ; preds = %65
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.iovec, ptr %77, i32 0, i32 1
  %79 = load i64, ptr %78, align 8, !tbaa !18
  br label %81

80:                                               ; preds = %65
  br label %81

81:                                               ; preds = %80, %76
  %82 = phi i64 [ %79, %76 ], [ 0, %80 ]
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds [510 x i8], ptr %9, i64 0, i64 0
  %85 = call ptr @mdbx_dump_val(ptr noundef %83, ptr noundef %84, i64 noundef 255)
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 5, ptr noundef @__func__.node_add_dupfix, i32 noundef 14, ptr noundef @.str.1, ptr noundef %69, i32 noundef %72, i64 noundef %73, i64 noundef %82, ptr noundef %85)
  br label %86

86:                                               ; preds = %81, %55
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  br label %89

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

100:                                              ; preds = %89
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  %104 = xor i1 %103, true
  %105 = xor i1 %104, true
  %106 = xor i1 %105, true
  %107 = zext i1 %106 to i32
  %108 = sext i32 %107 to i64
  %109 = call i64 @llvm.expect.i64(i64 %108, i64 0)
  %110 = icmp ne i64 %109, 0
  br i1 %110, label %111, label %117

111:                                              ; preds = %101
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.MDBX_cursor, ptr %112, i32 0, i32 5
  %114 = load ptr, ptr %113, align 8, !tbaa !20
  %115 = getelementptr inbounds %struct.MDBX_txn, ptr %114, i32 0, i32 9
  %116 = load ptr, ptr %115, align 8, !tbaa !22
  call void @mdbx_assert_fail(ptr noundef %116, ptr noundef @.str.4, ptr noundef @__func__.node_add_dupfix, i32 noundef 16) #8
  unreachable

117:                                              ; preds = %101
  br label %118

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119, %89
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  %124 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !12
  %125 = zext i8 %124 to i32
  %126 = and i32 %125, 1
  %127 = icmp ne i32 %126, 0
  %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 1)
  %133 = icmp ne i64 %132, 0
  br i1 %133, label %134, label %156

134:                                              ; preds = %123
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = call zeroext i8 @page_type_compat(ptr noundef %136) #9
  %138 = zext i8 %137 to i32
  %139 = icmp eq i32 %138, 34
  %140 = xor i1 %139, true
  %141 = xor i1 %140, true
  %142 = xor i1 %141, true
  %143 = zext i1 %142 to i32
  %144 = sext i32 %143 to i64
  %145 = call i64 @llvm.expect.i64(i64 %144, i64 0)
  %146 = icmp ne i64 %145, 0
  br i1 %146, label %147, label %153

147:                                              ; preds = %135
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.MDBX_cursor, ptr %148, i32 0, i32 5
  %150 = load ptr, ptr %149, align 8, !tbaa !20
  %151 = getelementptr inbounds %struct.MDBX_txn, ptr %150, i32 0, i32 9
  %152 = load ptr, ptr %151, align 8, !tbaa !22
  call void @mdbx_assert_fail(ptr noundef %152, ptr noundef @.str.5, ptr noundef @__func__.node_add_dupfix, i32 noundef 17) #8
  unreachable

153:                                              ; preds = %135
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155, %123
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.MDBX_cursor, ptr %159, i32 0, i32 6
  %161 = load ptr, ptr %160, align 8, !tbaa !27
  %162 = getelementptr inbounds %struct.tree, ptr %161, i32 0, i32 2
  %163 = load i32, ptr %162, align 4, !tbaa !28
  %164 = zext i32 %163 to i64
  store i64 %164, ptr %10, align 8, !tbaa !9
  br label %165

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

176:                                              ; preds = %165
  br label %177

177:                                              ; preds = %176
  %178 = load i64, ptr %10, align 8, !tbaa !9
  %179 = load ptr, ptr %7, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.iovec, ptr %179, i32 0, i32 1
  %181 = load i64, ptr %180, align 8, !tbaa !18
  %182 = icmp eq i64 %178, %181
  %183 = xor i1 %182, true
  %184 = xor i1 %183, true
  %185 = xor i1 %184, true
  %186 = zext i1 %185 to i32
  %187 = sext i32 %186 to i64
  %188 = call i64 @llvm.expect.i64(i64 %187, i64 0)
  %189 = icmp ne i64 %188, 0
  br i1 %189, label %190, label %196

190:                                              ; preds = %177
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.MDBX_cursor, ptr %191, i32 0, i32 5
  %193 = load ptr, ptr %192, align 8, !tbaa !20
  %194 = getelementptr inbounds %struct.MDBX_txn, ptr %193, i32 0, i32 9
  %195 = load ptr, ptr %194, align 8, !tbaa !22
  call void @mdbx_assert_fail(ptr noundef %195, ptr noundef @.str.6, ptr noundef @__func__.node_add_dupfix, i32 noundef 19) #8
  unreachable

196:                                              ; preds = %177
  br label %197

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198, %165
  br label %200

200:                                              ; preds = %199
  br label %201

201:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %202 = load ptr, ptr %8, align 8, !tbaa !5
  %203 = call i64 @page_numkeys(ptr noundef %202) #9
  store i64 %203, ptr %11, align 8, !tbaa !9
  br label %204

204:                                              ; preds = %201
  %205 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !12
  %206 = zext i8 %205 to i32
  %207 = and i32 %206, 1
  %208 = icmp ne i32 %207, 0
  %209 = xor i1 %208, true
  %210 = xor i1 %209, true
  %211 = zext i1 %210 to i32
  %212 = sext i32 %211 to i64
  %213 = call i64 @llvm.expect.i64(i64 %212, i64 1)
  %214 = icmp ne i64 %213, 0
  br i1 %214, label %215, label %245

215:                                              ; preds = %204
  br label %216

216:                                              ; preds = %215
  %217 = load i64, ptr %10, align 8, !tbaa !9
  %218 = load ptr, ptr %8, align 8, !tbaa !5
  %219 = call i64 @page_numkeys(ptr noundef %218) #9
  %220 = and i64 %217, %219
  %221 = load ptr, ptr %8, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.page, ptr %221, i32 0, i32 3
  %223 = getelementptr inbounds %struct.anon.3, ptr %222, i32 0, i32 1
  %224 = load i16, ptr %223, align 1, !tbaa !11
  %225 = zext i16 %224 to i64
  %226 = xor i64 %220, %225
  %227 = and i64 %226, 1
  %228 = icmp eq i64 %227, 0
  %229 = xor i1 %228, true
  %230 = xor i1 %229, true
  %231 = xor i1 %230, true
  %232 = zext i1 %231 to i32
  %233 = sext i32 %232 to i64
  %234 = call i64 @llvm.expect.i64(i64 %233, i64 0)
  %235 = icmp ne i64 %234, 0
  br i1 %235, label %236, label %242

236:                                              ; preds = %216
  %237 = load ptr, ptr %5, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.MDBX_cursor, ptr %237, i32 0, i32 5
  %239 = load ptr, ptr %238, align 8, !tbaa !20
  %240 = getelementptr inbounds %struct.MDBX_txn, ptr %239, i32 0, i32 9
  %241 = load ptr, ptr %240, align 8, !tbaa !22
  call void @mdbx_assert_fail(ptr noundef %241, ptr noundef @.str.7, ptr noundef @__func__.node_add_dupfix, i32 noundef 21) #8
  unreachable

242:                                              ; preds = %216
  br label %243

243:                                              ; preds = %242
  br label %244

244:                                              ; preds = %243
  br label %245

245:                                              ; preds = %244, %204
  br label %246

246:                                              ; preds = %245
  br label %247

247:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %248 = load ptr, ptr %8, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.page, ptr %248, i32 0, i32 3
  %250 = getelementptr inbounds %struct.anon.3, ptr %249, i32 0, i32 0
  %251 = load i16, ptr %250, align 1, !tbaa !11
  %252 = zext i16 %251 to i64
  %253 = add i64 %252, 2
  store i64 %253, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %254 = load ptr, ptr %8, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.page, ptr %254, i32 0, i32 3
  %256 = getelementptr inbounds %struct.anon.3, ptr %255, i32 0, i32 1
  %257 = load i16, ptr %256, align 1, !tbaa !11
  %258 = zext i16 %257 to i64
  %259 = load i64, ptr %10, align 8, !tbaa !9
  %260 = sub i64 %259, 2
  %261 = sub i64 %258, %260
  store i64 %261, ptr %13, align 8, !tbaa !9
  %262 = load i64, ptr %12, align 8, !tbaa !9
  %263 = load i64, ptr %13, align 8, !tbaa !9
  %264 = icmp sgt i64 %262, %263
  %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 0)
  %270 = icmp ne i64 %269, 0
  br i1 %270, label %271, label %278

271:                                              ; preds = %247
  %272 = load ptr, ptr %5, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.MDBX_cursor, ptr %272, i32 0, i32 5
  %274 = load ptr, ptr %273, align 8, !tbaa !20
  %275 = getelementptr inbounds %struct.MDBX_txn, ptr %274, i32 0, i32 1
  %276 = load i32, ptr %275, align 4, !tbaa !30
  %277 = or i32 %276, 2
  store i32 %277, ptr %275, align 4, !tbaa !30
  store i32 -30786, ptr %4, align 4
  store i32 1, ptr %14, align 4
  br label %399

278:                                              ; preds = %247
  %279 = load i64, ptr %12, align 8, !tbaa !9
  %280 = trunc i64 %279 to i16
  %281 = load ptr, ptr %8, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.page, ptr %281, i32 0, i32 3
  %283 = getelementptr inbounds %struct.anon.3, ptr %282, i32 0, i32 0
  store i16 %280, ptr %283, align 1, !tbaa !11
  %284 = load i64, ptr %13, align 8, !tbaa !9
  %285 = trunc i64 %284 to i16
  %286 = load ptr, ptr %8, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.page, ptr %286, i32 0, i32 3
  %288 = getelementptr inbounds %struct.anon.3, ptr %287, i32 0, i32 1
  store i16 %285, ptr %288, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %289 = load ptr, ptr %8, align 8, !tbaa !5
  %290 = load i64, ptr %6, align 8, !tbaa !9
  %291 = load i64, ptr %10, align 8, !tbaa !9
  %292 = call ptr @page_dupfix_ptr(ptr noundef %289, i64 noundef %290, i64 noundef %291) #9
  store ptr %292, ptr %15, align 8, !tbaa !5
  br label %293

293:                                              ; preds = %278
  %294 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !12
  %295 = zext i8 %294 to i32
  %296 = and i32 %295, 1
  %297 = icmp ne i32 %296, 0
  %298 = xor i1 %297, true
  %299 = xor i1 %298, true
  %300 = zext i1 %299 to i32
  %301 = sext i32 %300 to i64
  %302 = call i64 @llvm.expect.i64(i64 %301, i64 1)
  %303 = icmp ne i64 %302, 0
  br i1 %303, label %304, label %325

304:                                              ; preds = %293
  br label %305

305:                                              ; preds = %304
  %306 = load i64, ptr %11, align 8, !tbaa !9
  %307 = load i64, ptr %6, align 8, !tbaa !9
  %308 = icmp uge i64 %306, %307
  %309 = xor i1 %308, true
  %310 = xor i1 %309, true
  %311 = xor i1 %310, true
  %312 = zext i1 %311 to i32
  %313 = sext i32 %312 to i64
  %314 = call i64 @llvm.expect.i64(i64 %313, i64 0)
  %315 = icmp ne i64 %314, 0
  br i1 %315, label %316, label %322

316:                                              ; preds = %305
  %317 = load ptr, ptr %5, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.MDBX_cursor, ptr %317, i32 0, i32 5
  %319 = load ptr, ptr %318, align 8, !tbaa !20
  %320 = getelementptr inbounds %struct.MDBX_txn, ptr %319, i32 0, i32 9
  %321 = load ptr, ptr %320, align 8, !tbaa !22
  call void @mdbx_assert_fail(ptr noundef %321, ptr noundef @.str.8, ptr noundef @__func__.node_add_dupfix, i32 noundef 34) #8
  unreachable

322:                                              ; preds = %305
  br label %323

323:                                              ; preds = %322
  br label %324

324:                                              ; preds = %323
  br label %325

325:                                              ; preds = %324, %293
  br label %326

326:                                              ; preds = %325
  br label %327

327:                                              ; preds = %326
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %328 = load i64, ptr %11, align 8, !tbaa !9
  %329 = load i64, ptr %6, align 8, !tbaa !9
  %330 = sub i64 %328, %329
  store i64 %330, ptr %16, align 8, !tbaa !9
  %331 = load i64, ptr %16, align 8, !tbaa !9
  %332 = icmp ugt i64 %331, 0
  %333 = xor i1 %332, true
  %334 = xor i1 %333, true
  %335 = zext i1 %334 to i32
  %336 = sext i32 %335 to i64
  %337 = call i64 @llvm.expect.i64(i64 %336, i64 1)
  %338 = icmp ne i64 %337, 0
  br i1 %338, label %339, label %349

339:                                              ; preds = %327
  %340 = load ptr, ptr %15, align 8, !tbaa !5
  %341 = ptrtoint ptr %340 to i64
  %342 = load i64, ptr %10, align 8, !tbaa !9
  %343 = add nsw i64 %341, %342
  %344 = inttoptr i64 %343 to ptr
  %345 = load ptr, ptr %15, align 8, !tbaa !5
  %346 = load i64, ptr %16, align 8, !tbaa !9
  %347 = load i64, ptr %10, align 8, !tbaa !9
  %348 = mul i64 %346, %347
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %344, ptr align 1 %345, i64 %348, i1 false)
  br label %349

349:                                              ; preds = %339, %327
  %350 = load ptr, ptr %15, align 8, !tbaa !5
  %351 = load ptr, ptr %7, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.iovec, ptr %351, i32 0, i32 0
  %353 = load ptr, ptr %352, align 8, !tbaa !31
  %354 = load i64, ptr %10, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %350, ptr align 1 %353, i64 %354, i1 false)
  br label %355

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

366:                                              ; preds = %355
  br label %367

367:                                              ; preds = %366
  %368 = load i64, ptr %10, align 8, !tbaa !9
  %369 = load ptr, ptr %8, align 8, !tbaa !5
  %370 = call i64 @page_numkeys(ptr noundef %369) #9
  %371 = and i64 %368, %370
  %372 = load ptr, ptr %8, align 8, !tbaa !5
  %373 = getelementptr inbounds %struct.page, ptr %372, i32 0, i32 3
  %374 = getelementptr inbounds %struct.anon.3, ptr %373, i32 0, i32 1
  %375 = load i16, ptr %374, align 1, !tbaa !11
  %376 = zext i16 %375 to i64
  %377 = xor i64 %371, %376
  %378 = and i64 %377, 1
  %379 = icmp eq i64 %378, 0
  %380 = xor i1 %379, true
  %381 = xor i1 %380, true
  %382 = xor i1 %381, true
  %383 = zext i1 %382 to i32
  %384 = sext i32 %383 to i64
  %385 = call i64 @llvm.expect.i64(i64 %384, i64 0)
  %386 = icmp ne i64 %385, 0
  br i1 %386, label %387, label %393

387:                                              ; preds = %367
  %388 = load ptr, ptr %5, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.MDBX_cursor, ptr %388, i32 0, i32 5
  %390 = load ptr, ptr %389, align 8, !tbaa !20
  %391 = getelementptr inbounds %struct.MDBX_txn, ptr %390, i32 0, i32 9
  %392 = load ptr, ptr %391, align 8, !tbaa !22
  call void @mdbx_assert_fail(ptr noundef %392, ptr noundef @.str.7, ptr noundef @__func__.node_add_dupfix, i32 noundef 42) #8
  unreachable

393:                                              ; preds = %367
  br label %394

394:                                              ; preds = %393
  br label %395

395:                                              ; preds = %394
  br label %396

396:                                              ; preds = %395, %355
  br label %397

397:                                              ; preds = %396
  br label %398

398:                                              ; preds = %397
  store i32 0, ptr %4, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %399

399:                                              ; preds = %398, %271
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 510, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %400 = load i32, ptr %4, align 4
  ret i32 %400
}

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

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

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

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

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

declare ptr @mdbx_dump_val(ptr noundef, ptr noundef, i64 noundef) #4

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

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

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

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

; 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

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

attributes #0 = { hot nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint nounwind 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 25}
!13 = !{!"libmdbx_globals", !7, i64 0, !14, i64 16, !14, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !15, i64 27, !14, i64 28, !7, i64 32, !7, i64 40, !10, i64 80, !6, i64 88}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!13, !7, i64 26}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !10, i64 8}
!19 = !{!"iovec", !6, i64 0, !10, i64 8}
!20 = !{!21, !6, i64 16}
!21 = !{!"MDBX_cursor", !14, i64 0, !7, i64 4, !7, i64 6, !7, i64 7, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !7, i64 48, !7, i64 304, !6, i64 368, !6, i64 376}
!22 = !{!23, !6, i64 80}
!23 = !{!"MDBX_txn", !14, i64 0, !14, i64 4, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !24, 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, !26, i64 128, !6, i64 160, !7, i64 168}
!24 = !{!"geo", !25, i64 0, !25, i64 2, !14, i64 4, !14, i64 8, !7, i64 12, !7, i64 16}
!25 = !{!"short", !7, i64 0}
!26 = !{!"MDBX_canary", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!27 = !{!21, !6, i64 24}
!28 = !{!29, !14, i64 4}
!29 = !{!"tree", !25, i64 0, !25, i64 2, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !10, i64 24, !10, i64 32, !10, i64 40}
!30 = !{!23, !14, i64 4}
!31 = !{!19, !6, 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.0 }
%struct.anon.0 = 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 = external hidden unnamed_addr constant [18 x i8], align 1
@__func__.node_add_dupfix = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: hot nounwind uwtable
define dso_local range(i32 -30786, 1) i32 @node_add_dupfix(ptr nocapture noundef readonly %0, i64 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca [510 x i8], align 16
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  %6 = getelementptr inbounds i8, ptr %0, i64 5
  %7 = load i8, ptr %6, align 1, !tbaa !5
  %8 = sext i8 %7 to i64
  %9 = getelementptr inbounds [32 x ptr], ptr %5, i64 0, i64 %8
  %10 = load ptr, ptr %9, align 8, !tbaa !8
  %11 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !10
  %12 = and i8 %11, 1
  %.not = icmp ne i8 %12, 0
  %.not57 = icmp eq ptr %2, null
  %or.cond = and i1 %.not57, %.not
  br i1 %or.cond, label %13, label %14, !prof !15

13:                                               ; preds = %3
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.node_add_dupfix, i32 noundef 10) #6
  unreachable

14:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 510, ptr nonnull %4) #7
  %15 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 26), align 2, !tbaa !16
  %16 = icmp ugt i8 %15, 4
  br i1 %16, label %17, label %28, !prof !17

17:                                               ; preds = %14
  %18 = tail call zeroext i1 @is_subpage(ptr noundef %10) #8
  %19 = select i1 %18, ptr @.str.2, ptr @.str.3
  %20 = getelementptr inbounds i8, ptr %10, i64 16
  %21 = load i32, ptr %20, align 1, !tbaa !18
  br i1 %.not57, label %25, label %22

22:                                               ; preds = %17
  %23 = getelementptr inbounds i8, ptr %2, i64 8
  %24 = load i64, ptr %23, align 8, !tbaa !19
  br label %25

25:                                               ; preds = %17, %22
  %26 = phi i64 [ %24, %22 ], [ 0, %17 ]
  %27 = call ptr @mdbx_dump_val(ptr noundef %2, ptr noundef nonnull %4, i64 noundef 255) #7
  call void (i32, ptr, i32, ptr, ...) @debug_log(i32 noundef 5, ptr noundef nonnull @__func__.node_add_dupfix, i32 noundef 14, ptr noundef nonnull @.str.1, ptr noundef nonnull %19, i32 noundef %21, i64 noundef %1, i64 noundef %26, ptr noundef %27) #7
  %.pre = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !10
  br label %28

28:                                               ; preds = %14, %25
  %29 = phi i8 [ %11, %14 ], [ %.pre, %25 ]
  %30 = and i8 %29, 1
  %.not59 = icmp ne i8 %30, 0
  %or.cond72 = and i1 %.not57, %.not59
  br i1 %or.cond72, label %31, label %36, !prof !15

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  %33 = load ptr, ptr %32, align 8, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %33, i64 80
  %35 = load ptr, ptr %34, align 8, !tbaa !23
  call void @mdbx_assert_fail(ptr noundef %35, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.node_add_dupfix, i32 noundef 16) #6
  unreachable

36:                                               ; preds = %28
  %.not61 = icmp eq i8 %30, 0
  br i1 %.not61, label %.thread74, label %43, !prof !17

.thread74:                                        ; preds = %36
  %37 = getelementptr inbounds i8, ptr %0, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !28
  %39 = getelementptr inbounds i8, ptr %38, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !29
  %41 = zext i32 %40 to i64
  %42 = call i64 @page_numkeys(ptr noundef %10) #8
  %.phi.trans.insert = getelementptr inbounds i8, ptr %10, i64 14
  %.pre76 = load i16, ptr %.phi.trans.insert, align 1, !tbaa !5
  %.pre77 = zext i16 %.pre76 to i64
  br label %76

43:                                               ; preds = %36
  %44 = call zeroext i8 @page_type_compat(ptr noundef %10) #8
  %.not62 = icmp eq i8 %44, 34
  br i1 %.not62, label %50, label %45, !prof !31

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %0, i64 16
  %47 = load ptr, ptr %46, align 8, !tbaa !21
  %48 = getelementptr inbounds i8, ptr %47, i64 80
  %49 = load ptr, ptr %48, align 8, !tbaa !23
  call void @mdbx_assert_fail(ptr noundef %49, ptr noundef nonnull @.str.5, ptr noundef nonnull @__func__.node_add_dupfix, i32 noundef 17) #6
  unreachable

50:                                               ; preds = %43
  %51 = getelementptr inbounds i8, ptr %0, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !28
  %53 = getelementptr inbounds i8, ptr %52, i64 4
  %54 = load i32, ptr %53, align 4, !tbaa !29
  %55 = zext i32 %54 to i64
  %56 = getelementptr inbounds i8, ptr %2, i64 8
  %57 = load i64, ptr %56, align 8, !tbaa !19
  %.not64 = icmp eq i64 %57, %55
  br i1 %.not64, label %63, label %58, !prof !31

58:                                               ; preds = %50
  %59 = getelementptr inbounds i8, ptr %0, i64 16
  %60 = load ptr, ptr %59, align 8, !tbaa !21
  %61 = getelementptr inbounds i8, ptr %60, i64 80
  %62 = load ptr, ptr %61, align 8, !tbaa !23
  call void @mdbx_assert_fail(ptr noundef %62, ptr noundef nonnull @.str.6, ptr noundef nonnull @__func__.node_add_dupfix, i32 noundef 19) #6
  unreachable

63:                                               ; preds = %50
  %64 = call i64 @page_numkeys(ptr noundef %10) #8
  %65 = and i64 %64, %55
  %66 = getelementptr inbounds i8, ptr %10, i64 14
  %67 = load i16, ptr %66, align 1, !tbaa !5
  %68 = zext i16 %67 to i64
  %69 = xor i64 %65, %68
  %70 = and i64 %69, 1
  %.not66 = icmp eq i64 %70, 0
  br i1 %.not66, label %76, label %71, !prof !31

71:                                               ; preds = %63
  %72 = getelementptr inbounds i8, ptr %0, i64 16
  %73 = load ptr, ptr %72, align 8, !tbaa !21
  %74 = getelementptr inbounds i8, ptr %73, i64 80
  %75 = load ptr, ptr %74, align 8, !tbaa !23
  call void @mdbx_assert_fail(ptr noundef %75, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.node_add_dupfix, i32 noundef 21) #6
  unreachable

76:                                               ; preds = %.thread74, %63
  %.pre-phi = phi i64 [ %.pre77, %.thread74 ], [ %68, %63 ]
  %77 = phi i64 [ %42, %.thread74 ], [ %64, %63 ]
  %78 = phi i64 [ %41, %.thread74 ], [ %55, %63 ]
  %79 = getelementptr inbounds i8, ptr %10, i64 12
  %80 = load i16, ptr %79, align 1, !tbaa !5
  %81 = zext i16 %80 to i64
  %82 = getelementptr inbounds i8, ptr %10, i64 14
  %reass.sub = sub nsw i64 %.pre-phi, %78
  %83 = icmp slt i64 %reass.sub, %81
  br i1 %83, label %84, label %90, !prof !17

84:                                               ; preds = %76
  %85 = getelementptr inbounds i8, ptr %0, i64 16
  %86 = load ptr, ptr %85, align 8, !tbaa !21
  %87 = getelementptr inbounds i8, ptr %86, i64 4
  %88 = load i32, ptr %87, align 4, !tbaa !32
  %89 = or i32 %88, 2
  store i32 %89, ptr %87, align 4, !tbaa !32
  br label %125

90:                                               ; preds = %76
  %91 = add i16 %80, 2
  store i16 %91, ptr %79, align 1, !tbaa !5
  %92 = trunc i64 %reass.sub to i16
  %93 = add i16 %92, 2
  store i16 %93, ptr %82, align 1, !tbaa !5
  %94 = call ptr @page_dupfix_ptr(ptr noundef nonnull %10, i64 noundef %1, i64 noundef %78) #8
  %95 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !10
  %96 = and i8 %95, 1
  %.not67 = icmp ne i8 %96, 0
  %.not68 = icmp ult i64 %77, %1
  %or.cond73 = select i1 %.not67, i1 %.not68, i1 false
  br i1 %or.cond73, label %97, label %102, !prof !15

97:                                               ; preds = %90
  %98 = getelementptr inbounds i8, ptr %0, i64 16
  %99 = load ptr, ptr %98, align 8, !tbaa !21
  %100 = getelementptr inbounds i8, ptr %99, i64 80
  %101 = load ptr, ptr %100, align 8, !tbaa !23
  call void @mdbx_assert_fail(ptr noundef %101, ptr noundef nonnull @.str.8, ptr noundef nonnull @__func__.node_add_dupfix, i32 noundef 34) #6
  unreachable

102:                                              ; preds = %90
  %.not69 = icmp eq i64 %77, %1
  br i1 %.not69, label %109, label %103, !prof !17

103:                                              ; preds = %102
  %104 = sub i64 %77, %1
  %105 = ptrtoint ptr %94 to i64
  %106 = add nsw i64 %78, %105
  %107 = inttoptr i64 %106 to ptr
  %108 = mul i64 %104, %78
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %107, ptr align 1 %94, i64 %108, i1 false)
  br label %109

109:                                              ; preds = %103, %102
  %110 = load ptr, ptr %2, align 8, !tbaa !33
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %94, ptr align 1 %110, i64 %78, i1 false)
  %111 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !10
  %112 = and i8 %111, 1
  %.not70 = icmp eq i8 %112, 0
  br i1 %.not70, label %125, label %113, !prof !17

113:                                              ; preds = %109
  %114 = call i64 @page_numkeys(ptr noundef nonnull %10) #8
  %115 = and i64 %114, %78
  %116 = load i16, ptr %82, align 1, !tbaa !5
  %117 = zext i16 %116 to i64
  %118 = xor i64 %115, %117
  %119 = and i64 %118, 1
  %.not71 = icmp eq i64 %119, 0
  br i1 %.not71, label %125, label %120, !prof !31

120:                                              ; preds = %113
  %121 = getelementptr inbounds i8, ptr %0, i64 16
  %122 = load ptr, ptr %121, align 8, !tbaa !21
  %123 = getelementptr inbounds i8, ptr %122, i64 80
  %124 = load ptr, ptr %123, align 8, !tbaa !23
  call void @mdbx_assert_fail(ptr noundef %124, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.node_add_dupfix, i32 noundef 42) #6
  unreachable

125:                                              ; preds = %109, %113, %84
  %.0 = phi i32 [ -30786, %84 ], [ 0, %113 ], [ 0, %109 ]
  call void @llvm.lifetime.end.p0(i64 510, ptr nonnull %4) #7
  ret i32 %.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: noreturn
declare void @mdbx_assert_fail(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

declare ptr @mdbx_dump_val(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

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

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

; 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

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

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


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