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

; 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.6 }
%struct.anon.6 = 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.dpl = type { i64, i64, i64, i64, [18 x %struct.dp] }
%struct.dp = type { ptr, i32, i32 }

@globals = external global %struct.libmdbx_globals, align 8
@.str = external hidden unnamed_addr constant [36 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [73 x i8], align 1
@__func__.dpl_remove_ex = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @dpl_remove_ex(ptr noundef %0, i64 noundef %1, i64 noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store i64 %2, ptr %6, align 8, !tbaa !9
  br label %8

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

19:                                               ; preds = %8
  br label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.MDBX_txn, ptr %21, i32 0, i32 1
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = and i32 %23, 131072
  %25 = icmp eq i32 %24, 0
  %26 = xor i1 %25, true
  %27 = xor i1 %26, true
  %28 = xor i1 %27, true
  %29 = zext i1 %28 to i32
  %30 = sext i32 %29 to i64
  %31 = call i64 @llvm.expect.i64(i64 %30, i64 0)
  %32 = icmp ne i64 %31, 0
  br i1 %32, label %33, label %37

33:                                               ; preds = %20
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.MDBX_txn, ptr %34, i32 0, i32 9
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  call void @mdbx_assert_fail(ptr noundef %36, ptr noundef @.str, ptr noundef @__func__.dpl_remove_ex, i32 noundef 200) #5
  unreachable

37:                                               ; preds = %20
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38, %8
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  %42 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !11
  %43 = zext i8 %42 to i32
  %44 = and i32 %43, 1
  %45 = icmp ne i32 %44, 0
  %46 = xor i1 %45, true
  %47 = xor i1 %46, true
  %48 = zext i1 %47 to i32
  %49 = sext i32 %48 to i64
  %50 = call i64 @llvm.expect.i64(i64 %49, i64 1)
  %51 = icmp ne i64 %50, 0
  br i1 %51, label %52, label %75

52:                                               ; preds = %41
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.MDBX_txn, ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !15
  %57 = and i32 %56, 524288
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %53
  br label %60

60:                                               ; preds = %59, %53
  %61 = phi i1 [ true, %53 ], [ false, %59 ]
  %62 = xor i1 %61, true
  %63 = xor i1 %62, true
  %64 = xor i1 %63, true
  %65 = zext i1 %64 to i32
  %66 = sext i32 %65 to i64
  %67 = call i64 @llvm.expect.i64(i64 %66, i64 0)
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %69, label %73

69:                                               ; preds = %60
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.MDBX_txn, ptr %70, i32 0, i32 9
  %72 = load ptr, ptr %71, align 8, !tbaa !20
  call void @mdbx_assert_fail(ptr noundef %72, ptr noundef @.str.1, ptr noundef @__func__.dpl_remove_ex, i32 noundef 201) #5
  unreachable

73:                                               ; preds = %60
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74, %41
  br label %76

76:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.MDBX_txn, ptr %77, i32 0, i32 17
  %79 = getelementptr inbounds %struct.anon.2, ptr %78, i32 0, i32 7
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  store ptr %80, ptr %7, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %76
  %82 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !11
  %83 = zext i8 %82 to i32
  %84 = and i32 %83, 1
  %85 = icmp ne i32 %84, 0
  %86 = xor i1 %85, true
  %87 = xor i1 %86, true
  %88 = zext i1 %87 to i32
  %89 = sext i32 %88 to i64
  %90 = call i64 @llvm.expect.i64(i64 %89, i64 1)
  %91 = icmp ne i64 %90, 0
  br i1 %91, label %92, label %115

92:                                               ; preds = %81
  br label %93

93:                                               ; preds = %92
  %94 = load i64, ptr %5, align 8, !tbaa !9
  %95 = icmp sgt i64 %94, 0
  br i1 %95, label %96, label %102

96:                                               ; preds = %93
  %97 = load i64, ptr %5, align 8, !tbaa !9
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.dpl, ptr %98, i32 0, i32 1
  %100 = load i64, ptr %99, align 8, !tbaa !22
  %101 = icmp ule i64 %97, %100
  br label %102

102:                                              ; preds = %96, %93
  %103 = phi i1 [ false, %93 ], [ %101, %96 ]
  %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 %112

111:                                              ; preds = %102
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.10, ptr noundef @__func__.dpl_remove_ex, i32 noundef 204) #5
  unreachable

112:                                              ; preds = %102
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114, %81
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  %119 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !11
  %120 = zext i8 %119 to i32
  %121 = and i32 %120, 1
  %122 = icmp ne i32 %121, 0
  %123 = xor i1 %122, true
  %124 = xor i1 %123, true
  %125 = zext i1 %124 to i32
  %126 = sext i32 %125 to i64
  %127 = call i64 @llvm.expect.i64(i64 %126, i64 1)
  %128 = icmp ne i64 %127, 0
  br i1 %128, label %129, label %161

129:                                              ; preds = %118
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.dpl, ptr %131, i32 0, i32 4
  %133 = getelementptr inbounds [18 x %struct.dp], ptr %132, i64 0, i64 0
  %134 = getelementptr inbounds %struct.dp, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 8, !tbaa !24
  %136 = icmp eq i32 %135, 0
  br i1 %136, label %137, label %148

137:                                              ; preds = %130
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.dpl, ptr %138, i32 0, i32 4
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.dpl, ptr %140, i32 0, i32 1
  %142 = load i64, ptr %141, align 8, !tbaa !22
  %143 = add i64 %142, 1
  %144 = getelementptr inbounds [18 x %struct.dp], ptr %139, i64 0, i64 %143
  %145 = getelementptr inbounds %struct.dp, ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 8, !tbaa !24
  %147 = icmp eq i32 %146, -1
  br label %148

148:                                              ; preds = %137, %130
  %149 = phi i1 [ false, %130 ], [ %147, %137 ]
  %150 = xor i1 %149, true
  %151 = xor i1 %150, true
  %152 = xor i1 %151, true
  %153 = zext i1 %152 to i32
  %154 = sext i32 %153 to i64
  %155 = call i64 @llvm.expect.i64(i64 %154, i64 0)
  %156 = icmp ne i64 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %148
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.3, ptr noundef @__func__.dpl_remove_ex, i32 noundef 205) #5
  unreachable

158:                                              ; preds = %148
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160, %118
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  %164 = load i64, ptr %6, align 8, !tbaa !9
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.dpl, ptr %165, i32 0, i32 2
  %167 = load i64, ptr %166, align 8, !tbaa !26
  %168 = sub i64 %167, %164
  store i64 %168, ptr %166, align 8, !tbaa !26
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.dpl, ptr %169, i32 0, i32 0
  %171 = load i64, ptr %170, align 8, !tbaa !27
  %172 = load i64, ptr %5, align 8, !tbaa !9
  %173 = icmp uge i64 %171, %172
  %174 = zext i1 %173 to i32
  %175 = sext i32 %174 to i64
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.dpl, ptr %176, i32 0, i32 0
  %178 = load i64, ptr %177, align 8, !tbaa !27
  %179 = sub i64 %178, %175
  store i64 %179, ptr %177, align 8, !tbaa !27
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.dpl, ptr %180, i32 0, i32 1
  %182 = load i64, ptr %181, align 8, !tbaa !22
  %183 = sub i64 %182, 1
  store i64 %183, ptr %181, align 8, !tbaa !22
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.dpl, ptr %184, i32 0, i32 4
  %186 = getelementptr inbounds [18 x %struct.dp], ptr %185, i64 0, i64 0
  %187 = load i64, ptr %5, align 8, !tbaa !9
  %188 = getelementptr inbounds %struct.dp, ptr %186, i64 %187
  %189 = load ptr, ptr %7, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.dpl, ptr %189, i32 0, i32 4
  %191 = getelementptr inbounds [18 x %struct.dp], ptr %190, i64 0, i64 0
  %192 = load i64, ptr %5, align 8, !tbaa !9
  %193 = getelementptr inbounds %struct.dp, ptr %191, i64 %192
  %194 = getelementptr inbounds %struct.dp, ptr %193, i64 1
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.dpl, ptr %195, i32 0, i32 1
  %197 = load i64, ptr %196, align 8, !tbaa !22
  %198 = load i64, ptr %5, align 8, !tbaa !9
  %199 = sub i64 %197, %198
  %200 = add i64 %199, 2
  %201 = mul i64 %200, 16
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %188, ptr align 8 %194, i64 %201, i1 false)
  br label %202

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

213:                                              ; preds = %202
  br label %214

214:                                              ; preds = %213
  %215 = load ptr, ptr %7, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.dpl, ptr %215, i32 0, i32 4
  %217 = getelementptr inbounds [18 x %struct.dp], ptr %216, i64 0, i64 0
  %218 = getelementptr inbounds %struct.dp, ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 8, !tbaa !24
  %220 = icmp eq i32 %219, 0
  br i1 %220, label %221, label %232

221:                                              ; preds = %214
  %222 = load ptr, ptr %7, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.dpl, ptr %222, i32 0, i32 4
  %224 = load ptr, ptr %7, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.dpl, ptr %224, i32 0, i32 1
  %226 = load i64, ptr %225, align 8, !tbaa !22
  %227 = add i64 %226, 1
  %228 = getelementptr inbounds [18 x %struct.dp], ptr %223, i64 0, i64 %227
  %229 = getelementptr inbounds %struct.dp, ptr %228, i32 0, i32 1
  %230 = load i32, ptr %229, align 8, !tbaa !24
  %231 = icmp eq i32 %230, -1
  br label %232

232:                                              ; preds = %221, %214
  %233 = phi i1 [ false, %214 ], [ %231, %221 ]
  %234 = xor i1 %233, true
  %235 = xor i1 %234, true
  %236 = xor i1 %235, true
  %237 = zext i1 %236 to i32
  %238 = sext i32 %237 to i64
  %239 = call i64 @llvm.expect.i64(i64 %238, i64 0)
  %240 = icmp ne i64 %239, 0
  br i1 %240, label %241, label %242

241:                                              ; preds = %232
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.3, ptr noundef @__func__.dpl_remove_ex, i32 noundef 210) #5
  unreachable

242:                                              ; preds = %232
  br label %243

243:                                              ; preds = %242
  br label %244

244:                                              ; preds = %243
  br label %245

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

246:                                              ; preds = %245
  br label %247

247:                                              ; preds = %246
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret void
}

; 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) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #1 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { noreturn }
attributes #6 = { 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, !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, !7, i64 25}
!12 = !{!"libmdbx_globals", !7, i64 0, !13, i64 16, !13, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !14, i64 27, !13, i64 28, !7, i64 32, !7, i64 40, !10, i64 80, !6, i64 88}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!16, !13, i64 4}
!16 = !{!"MDBX_txn", !13, i64 0, !13, i64 4, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !17, 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, !19, i64 128, !6, i64 160, !7, i64 168}
!17 = !{!"geo", !18, i64 0, !18, i64 2, !13, i64 4, !13, i64 8, !7, i64 12, !7, i64 16}
!18 = !{!"short", !7, i64 0}
!19 = !{!"MDBX_canary", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!20 = !{!16, !6, i64 80}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !10, i64 8}
!23 = !{!"dpl", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32}
!24 = !{!25, !13, i64 8}
!25 = !{!"dp", !6, i64 0, !13, i64 8, !13, i64 12}
!26 = !{!23, !10, i64 16}
!27 = !{!23, !10, 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.6 }
%struct.anon.6 = 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.dp = type { ptr, i32, i32 }

@globals = external local_unnamed_addr global %struct.libmdbx_globals, align 8
@.str = external hidden unnamed_addr constant [36 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [73 x i8], align 1
@__func__.dpl_remove_ex = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @dpl_remove_ex(ptr nocapture noundef readonly %0, i64 noundef %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !5
  %5 = and i8 %4, 1
  %.not = icmp eq i8 %5, 0
  br i1 %.not, label %.thread36, label %8, !prof !13

.thread36:                                        ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 496
  %7 = load ptr, ptr %6, align 8, !tbaa !14
  %.phi.trans.insert = getelementptr inbounds i8, ptr %7, i64 8
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !15
  br label %37

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 4
  %10 = load i32, ptr %9, align 4, !tbaa !17
  %11 = and i32 %10, 131072
  %.not25 = icmp eq i32 %11, 0
  br i1 %.not25, label %15, label %12, !prof !22

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  %14 = load ptr, ptr %13, align 8, !tbaa !23
  tail call void @mdbx_assert_fail(ptr noundef %14, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.dpl_remove_ex, i32 noundef 200) #3
  unreachable

15:                                               ; preds = %8
  %16 = and i32 %10, 524288
  %.not27 = icmp eq i32 %16, 0
  br i1 %.not27, label %20, label %17, !prof !22

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %0, i64 80
  %19 = load ptr, ptr %18, align 8, !tbaa !23
  tail call void @mdbx_assert_fail(ptr noundef %19, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.dpl_remove_ex, i32 noundef 201) #3
  unreachable

20:                                               ; preds = %15
  %21 = getelementptr inbounds i8, ptr %0, i64 496
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  %23 = icmp sgt i64 %1, 0
  br i1 %23, label %24, label %.critedge, !prof !22

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %22, i64 8
  %26 = load i64, ptr %25, align 8, !tbaa !15
  %27 = icmp ult i64 %26, %1
  br i1 %27, label %.critedge, label %28, !prof !13

.critedge:                                        ; preds = %20, %24
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.10, ptr noundef nonnull @__func__.dpl_remove_ex, i32 noundef 204) #3
  unreachable

28:                                               ; preds = %24
  %29 = getelementptr inbounds i8, ptr %22, i64 40
  %30 = load i32, ptr %29, align 8, !tbaa !24
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %.critedge32, !prof !22

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %22, i64 32
  %34 = add i64 %26, 1
  %35 = getelementptr inbounds [18 x %struct.dp], ptr %33, i64 0, i64 %34, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !24
  %.not37 = icmp eq i32 %36, -1
  br i1 %.not37, label %37, label %.critedge32, !prof !22

.critedge32:                                      ; preds = %28, %32
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.dpl_remove_ex, i32 noundef 205) #3
  unreachable

37:                                               ; preds = %.thread36, %32
  %38 = phi i64 [ %.pre, %.thread36 ], [ %26, %32 ]
  %39 = phi ptr [ %7, %.thread36 ], [ %22, %32 ]
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %41 = load i64, ptr %40, align 8, !tbaa !26
  %42 = sub i64 %41, %2
  store i64 %42, ptr %40, align 8, !tbaa !26
  %43 = load i64, ptr %39, align 8, !tbaa !27
  %44 = icmp uge i64 %43, %1
  %.neg = sext i1 %44 to i64
  %45 = add i64 %43, %.neg
  store i64 %45, ptr %39, align 8, !tbaa !27
  %46 = getelementptr inbounds i8, ptr %39, i64 8
  %47 = add i64 %38, -1
  store i64 %47, ptr %46, align 8, !tbaa !15
  %48 = getelementptr inbounds i8, ptr %39, i64 32
  %49 = getelementptr inbounds %struct.dp, ptr %48, i64 %1
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %51 = sub i64 %47, %1
  %52 = shl i64 %51, 4
  %53 = add i64 %52, 32
  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 8 %49, ptr nonnull align 8 %50, i64 %53, i1 false)
  %54 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !5
  %55 = and i8 %54, 1
  %.not30 = icmp eq i8 %55, 0
  br i1 %.not30, label %65, label %56, !prof !13

56:                                               ; preds = %37
  %57 = getelementptr inbounds i8, ptr %39, i64 40
  %58 = load i32, ptr %57, align 8, !tbaa !24
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %.critedge34, !prof !22

60:                                               ; preds = %56
  %61 = load i64, ptr %46, align 8, !tbaa !15
  %62 = add i64 %61, 1
  %63 = getelementptr inbounds [18 x %struct.dp], ptr %48, i64 0, i64 %62, i32 1
  %64 = load i32, ptr %63, align 8, !tbaa !24
  %.not38 = icmp eq i32 %64, -1
  br i1 %.not38, label %65, label %.critedge34, !prof !22

.critedge34:                                      ; preds = %56, %60
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.dpl_remove_ex, i32 noundef 210) #3
  unreachable

65:                                               ; preds = %60, %37
  ret void
}

; 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) #2

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

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

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


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