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

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

@globals = external global %struct.libmdbx_globals, align 8
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.rkl_contain = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1

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

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

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

; Function Attrs: nounwind willreturn memory(read) uwtable
declare dso_local zeroext i1 @rkl_check(ptr noundef) #2

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

; Function Attrs: hot nounwind willreturn memory(read) uwtable
define dso_local zeroext i1 @rkl_contain(ptr noundef %0, i64 noundef %1) #4 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  br label %9

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

20:                                               ; preds = %9
  br label %21

21:                                               ; preds = %20
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call zeroext i1 @rkl_check(ptr noundef %22) #6
  %24 = xor i1 %23, true
  %25 = xor i1 %24, true
  %26 = xor i1 %25, true
  %27 = zext i1 %26 to i32
  %28 = sext i32 %27 to i64
  %29 = call i64 @llvm.expect.i64(i64 %28, i64 0)
  %30 = icmp ne i64 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %21
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.1, ptr noundef @__func__.rkl_contain, i32 noundef 124) #7
  unreachable

32:                                               ; preds = %21
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33, %9
  br label %35

35:                                               ; preds = %34
  %36 = load i64, ptr %5, align 8, !tbaa !9
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.MDBX_rkl, ptr %37, i32 0, i32 0
  %39 = load i64, ptr %38, align 8, !tbaa !15
  %40 = icmp uge i64 %36, %39
  br i1 %40, label %41, label %48

41:                                               ; preds = %35
  %42 = load i64, ptr %5, align 8, !tbaa !9
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.MDBX_rkl, ptr %43, i32 0, i32 1
  %45 = load i64, ptr %44, align 8, !tbaa !17
  %46 = icmp ult i64 %42, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %41
  store i1 true, ptr %3, align 1
  br label %194

48:                                               ; preds = %41, %35
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.MDBX_rkl, ptr %49, i32 0, i32 2
  %51 = load i32, ptr %50, align 8, !tbaa !18
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %193

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.MDBX_rkl, ptr %54, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !19
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.MDBX_rkl, ptr %57, i32 0, i32 2
  %59 = load i32, ptr %58, align 8, !tbaa !18
  %60 = zext i32 %59 to i64
  %61 = load i64, ptr %5, align 8, !tbaa !9
  %62 = call ptr @rkl_bsearch(ptr noundef %56, i64 noundef %60, i64 noundef %61)
  store ptr %62, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.MDBX_rkl, ptr %63, i32 0, i32 4
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.MDBX_rkl, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !18
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds i64, ptr %65, i64 %69
  store ptr %70, ptr %7, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %53
  %72 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !11
  %73 = zext i8 %72 to i32
  %74 = and i32 %73, 1
  %75 = icmp ne i32 %74, 0
  %76 = xor i1 %75, true
  %77 = xor i1 %76, true
  %78 = zext i1 %77 to i32
  %79 = sext i32 %78 to i64
  %80 = call i64 @llvm.expect.i64(i64 %79, i64 1)
  %81 = icmp ne i64 %80, 0
  br i1 %81, label %82, label %106

82:                                               ; preds = %71
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.MDBX_rkl, ptr %85, i32 0, i32 4
  %87 = load ptr, ptr %86, align 8, !tbaa !19
  %88 = icmp uge ptr %84, %87
  br i1 %88, label %89, label %93

89:                                               ; preds = %83
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = icmp ule ptr %90, %91
  br label %93

93:                                               ; preds = %89, %83
  %94 = phi i1 [ false, %83 ], [ %92, %89 ]
  %95 = xor i1 %94, true
  %96 = xor i1 %95, true
  %97 = xor i1 %96, true
  %98 = zext i1 %97 to i32
  %99 = sext i32 %98 to i64
  %100 = call i64 @llvm.expect.i64(i64 %99, i64 0)
  %101 = icmp ne i64 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %93
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.2, ptr noundef @__func__.rkl_contain, i32 noundef 130) #7
  unreachable

103:                                              ; preds = %93
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105, %71
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MDBX_rkl, ptr %110, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !19
  %113 = icmp ne ptr %109, %112
  br i1 %113, label %114, label %147

114:                                              ; preds = %108
  br label %115

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

126:                                              ; preds = %115
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds i64, ptr %128, i64 -1
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = load i64, ptr %5, align 8, !tbaa !9
  %132 = icmp ult i64 %130, %131
  %133 = xor i1 %132, true
  %134 = xor i1 %133, true
  %135 = xor i1 %134, true
  %136 = zext i1 %135 to i32
  %137 = sext i32 %136 to i64
  %138 = call i64 @llvm.expect.i64(i64 %137, i64 0)
  %139 = icmp ne i64 %138, 0
  br i1 %139, label %140, label %141

140:                                              ; preds = %127
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.3, ptr noundef @__func__.rkl_contain, i32 noundef 132) #7
  unreachable

141:                                              ; preds = %127
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  br label %144

144:                                              ; preds = %143, %115
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146, %108
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = icmp ne ptr %148, %149
  br i1 %150, label %151, label %189

151:                                              ; preds = %147
  br label %152

152:                                              ; preds = %151
  %153 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !11
  %154 = zext i8 %153 to i32
  %155 = and i32 %154, 1
  %156 = icmp ne i32 %155, 0
  %157 = xor i1 %156, true
  %158 = xor i1 %157, true
  %159 = zext i1 %158 to i32
  %160 = sext i32 %159 to i64
  %161 = call i64 @llvm.expect.i64(i64 %160, i64 1)
  %162 = icmp ne i64 %161, 0
  br i1 %162, label %163, label %182

163:                                              ; preds = %152
  br label %164

164:                                              ; preds = %163
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds i64, ptr %165, i64 0
  %167 = load i64, ptr %166, align 8, !tbaa !9
  %168 = load i64, ptr %5, align 8, !tbaa !9
  %169 = icmp ult i64 %167, %168
  %170 = xor i1 %169, true
  %171 = xor i1 %170, true
  %172 = xor i1 %171, true
  %173 = xor i1 %172, true
  %174 = zext i1 %173 to i32
  %175 = sext i32 %174 to i64
  %176 = call i64 @llvm.expect.i64(i64 %175, i64 0)
  %177 = icmp ne i64 %176, 0
  br i1 %177, label %178, label %179

178:                                              ; preds = %164
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.4, ptr noundef @__func__.rkl_contain, i32 noundef 134) #7
  unreachable

179:                                              ; preds = %164
  br label %180

180:                                              ; preds = %179
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181, %152
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = load i64, ptr %185, align 8, !tbaa !9
  %187 = load i64, ptr %5, align 8, !tbaa !9
  %188 = icmp eq i64 %186, %187
  store i1 %188, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %190

189:                                              ; preds = %147
  store i32 0, ptr %8, align 4
  br label %190

190:                                              ; preds = %189, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %191 = load i32, ptr %8, align 4
  switch i32 %191, label %196 [
    i32 0, label %192
    i32 1, label %194
  ]

192:                                              ; preds = %190
  br label %193

193:                                              ; preds = %192, %48
  store i1 false, ptr %3, align 1
  br label %194

194:                                              ; preds = %193, %190, %47
  %195 = load i1, ptr %3, align 1
  ret i1 %195

196:                                              ; preds = %190
  unreachable
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden ptr @rkl_bsearch(ptr noundef, i64 noundef, i64 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #2 = { 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 #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 = { hot 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 = { alwaysinline nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { noreturn }
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, !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, !10, i64 0}
!16 = !{!"MDBX_rkl", !10, i64 0, !10, i64 8, !13, i64 16, !13, i64 20, !6, i64 24, !7, i64 32}
!17 = !{!16, !10, i64 8}
!18 = !{!16, !13, i64 16}
!19 = !{!16, !6, i64 24}


; 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 }
%struct.anon = 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.1 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.rkl_contain = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn memory(read) uwtable
declare dso_local zeroext i1 @rkl_check(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: hot mustprogress nofree nounwind willreturn memory(read) uwtable
define dso_local zeroext i1 @rkl_contain(ptr noundef %0, i64 noundef %1) local_unnamed_addr #2 {
  %3 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !5
  %4 = and i8 %3, 1
  %.not = icmp eq i8 %4, 0
  br i1 %.not, label %8, label %5, !prof !13

5:                                                ; preds = %2
  %6 = tail call zeroext i1 @rkl_check(ptr noundef %0) #4
  br i1 %6, label %8, label %7, !prof !14

7:                                                ; preds = %5
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.rkl_contain, i32 noundef 124) #5
  unreachable

8:                                                ; preds = %2, %5
  %9 = load i64, ptr %0, align 8, !tbaa !15
  %.not31 = icmp ugt i64 %9, %1
  br i1 %.not31, label %14, label %10

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i64, ptr %11, align 8, !tbaa !17
  %13 = icmp ugt i64 %12, %1
  br i1 %13, label %.thread44, label %14

14:                                               ; preds = %10, %8
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load i32, ptr %15, align 8, !tbaa !18
  %.not32 = icmp eq i32 %16, 0
  br i1 %.not32, label %.thread44, label %17

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = load ptr, ptr %18, align 8, !tbaa !19
  %20 = zext i32 %16 to i64
  %21 = tail call ptr @rkl_bsearch(ptr noundef %19, i64 noundef %20, i64 noundef %1)
  %22 = load ptr, ptr %18, align 8, !tbaa !19
  %23 = load i32, ptr %15, align 8, !tbaa !18
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds i64, ptr %22, i64 %24
  %26 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !5
  %27 = and i8 %26, 1
  %.not33 = icmp ne i8 %27, 0
  br i1 %.not33, label %28, label %.thread47, !prof !14

28:                                               ; preds = %17
  %29 = icmp ult ptr %21, %22
  %30 = icmp ugt ptr %21, %25
  %.not36 = select i1 %29, i1 true, i1 %30
  br i1 %.not36, label %31, label %.thread, !prof !13

31:                                               ; preds = %28
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.rkl_contain, i32 noundef 130) #5
  unreachable

.thread:                                          ; preds = %28
  %.not3742 = icmp eq ptr %21, %22
  br i1 %.not3742, label %36, label %32

32:                                               ; preds = %.thread
  %33 = getelementptr inbounds i8, ptr %21, i64 -8
  %34 = load i64, ptr %33, align 8, !tbaa !20
  %.not39 = icmp ult i64 %34, %1
  br i1 %.not39, label %36, label %35, !prof !14

35:                                               ; preds = %32
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.rkl_contain, i32 noundef 132) #5
  unreachable

36:                                               ; preds = %.thread, %32
  %.not40.not = icmp eq ptr %21, %25
  br i1 %.not40.not, label %.thread44, label %37

.thread47:                                        ; preds = %17
  %.not40.not48 = icmp eq ptr %21, %25
  br i1 %.not40.not48, label %.thread44, label %.thread49

.thread49:                                        ; preds = %.thread47
  %.pre50 = load i64, ptr %21, align 8, !tbaa !20
  br label %40

37:                                               ; preds = %36
  %.pre = load i64, ptr %21, align 8, !tbaa !20
  %38 = icmp ult i64 %.pre, %1
  %or.cond = select i1 %.not33, i1 %38, i1 false
  br i1 %or.cond, label %39, label %40, !prof !21

39:                                               ; preds = %37
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.rkl_contain, i32 noundef 134) #5
  unreachable

40:                                               ; preds = %.thread49, %37
  %.pre51 = phi i64 [ %.pre50, %.thread49 ], [ %.pre, %37 ]
  %41 = icmp eq i64 %.pre51, %1
  br label %.thread44

.thread44:                                        ; preds = %.thread47, %36, %14, %40, %10
  %.1 = phi i1 [ %41, %40 ], [ true, %10 ], [ false, %14 ], [ false, %36 ], [ false, %.thread47 ]
  ret i1 %.1
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden ptr @rkl_bsearch(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

attributes #0 = { 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 #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 = { hot 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 #3 = { alwaysinline nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(read) }
attributes #5 = { 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 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!15 = !{!16, !11, i64 0}
!16 = !{!"MDBX_rkl", !11, i64 0, !11, i64 8, !9, i64 16, !9, i64 20, !12, i64 24, !7, i64 32}
!17 = !{!16, !11, i64 8}
!18 = !{!16, !9, i64 16}
!19 = !{!16, !12, i64 24}
!20 = !{!11, !11, i64 0}
!21 = !{!"branch_weights", i32 2097152, i32 -100663296}


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