; LLVM IR from erthink/libmdbx :: src (api-misc)

; 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.MDBX_env = type { %union.mdbx_atomic_uint32_t, i32, i32, %struct.osal_mmap, i32, i32, %struct.osal_mmap, ptr, i16, i16, i16, i16, i16, i16, %union.mdbx_atomic_uint32_t, i8, i8, i16, i32, i32, i32, i32, %struct.anon.11, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i64, %struct.anon.12, %struct.anon.16, i8, ptr, ptr, ptr, %struct.anon.17, %union.pthread_mutex_t, i32, i32, ptr, %struct.osal_ioring, %union.pthread_mutex_t, [71 x %union.mdbx_atomic_uint64_t] }
%struct.osal_mmap = type { %union.anon.10, i32, i64, i64, i64 }
%union.anon.10 = type { ptr }
%union.mdbx_atomic_uint32_t = type { i32 }
%struct.anon.11 = type { ptr, ptr, ptr, ptr }
%struct.anon.12 = type { i32, i32, i32, i32, i64, i8, i8, i8, i8, i32, i32, i8, i8, i8, %struct.anon.13, %union.anon.14 }
%struct.anon.13 = type { i16, i16, i16, i16 }
%union.anon.14 = type { i32 }
%struct.anon.16 = type { i64, i64, i64, i64, i64 }
%struct.anon.17 = type { i64 }
%struct.osal_ioring = type { i32, i32, i32, ptr, ptr, ptr }
%union.mdbx_atomic_uint64_t = type { i64 }
%struct.kvx = type { %struct.clc2, %struct.iovec }
%struct.clc2 = type { %struct.clc, %struct.clc }
%struct.clc = type { ptr, i64, i64 }
%struct.iovec = type { ptr, i64 }

@globals = external global %struct.libmdbx_globals, align 8
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@__func__.mdbx_cmp = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [68 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: nounwind willreturn memory(read) uwtable
define dso_local i32 @mdbx_cmp(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  br label %9

9:                                                ; preds = %4
  %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 %36

20:                                               ; preds = %9
  br label %21

21:                                               ; preds = %20
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.MDBX_txn, ptr %22, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !15
  %25 = icmp eq i32 %24, 332741169
  %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 %34

33:                                               ; preds = %21
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.1, ptr noundef @__func__.mdbx_cmp, i32 noundef 106) #4
  unreachable

34:                                               ; preds = %21
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35, %9
  br label %37

37:                                               ; preds = %36
  br label %38

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

49:                                               ; preds = %38
  br label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = zext i32 %52 to i64
  %54 = call zeroext i8 @dbi_state(ptr noundef %51, i64 noundef %53)
  %55 = zext i8 %54 to i32
  %56 = and i32 %55, 16
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %64

58:                                               ; preds = %50
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !9
  %61 = zext i32 %60 to i64
  %62 = call zeroext i1 @dbi_changed(ptr noundef %59, i64 noundef %61)
  %63 = xor i1 %62, true
  br label %64

64:                                               ; preds = %58, %50
  %65 = phi i1 [ false, %50 ], [ %63, %58 ]
  %66 = xor i1 %65, true
  %67 = xor i1 %66, true
  %68 = xor i1 %67, true
  %69 = zext i1 %68 to i32
  %70 = sext i32 %69 to i64
  %71 = call i64 @llvm.expect.i64(i64 %70, i64 0)
  %72 = icmp ne i64 %71, 0
  br i1 %72, label %73, label %77

73:                                               ; preds = %64
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.MDBX_txn, ptr %74, i32 0, i32 9
  %76 = load ptr, ptr %75, align 8, !tbaa !20
  call void @mdbx_assert_fail(ptr noundef %76, ptr noundef @.str.2, ptr noundef @__func__.mdbx_cmp, i32 noundef 107) #4
  unreachable

77:                                               ; preds = %64
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78, %38
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  %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 %129

92:                                               ; preds = %81
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %6, align 4, !tbaa !9
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.MDBX_txn, ptr %95, i32 0, i32 9
  %97 = load ptr, ptr %96, align 8, !tbaa !20
  %98 = getelementptr inbounds %struct.MDBX_env, ptr %97, i32 0, i32 42
  %99 = load i32, ptr %98, align 8, !tbaa !21
  %100 = icmp ult i32 %94, %99
  br i1 %100, label %101, label %114

101:                                              ; preds = %93
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.MDBX_txn, ptr %102, i32 0, i32 9
  %104 = load ptr, ptr %103, align 8, !tbaa !20
  %105 = getelementptr inbounds %struct.MDBX_env, ptr %104, i32 0, i32 26
  %106 = load ptr, ptr %105, align 8, !tbaa !30
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds i8, ptr %106, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !31
  %111 = zext i8 %110 to i32
  %112 = and i32 %111, 128
  %113 = icmp ne i32 %112, 0
  br label %114

114:                                              ; preds = %101, %93
  %115 = phi i1 [ false, %93 ], [ %113, %101 ]
  %116 = xor i1 %115, true
  %117 = xor i1 %116, true
  %118 = xor i1 %117, true
  %119 = zext i1 %118 to i32
  %120 = sext i32 %119 to i64
  %121 = call i64 @llvm.expect.i64(i64 %120, i64 0)
  %122 = icmp ne i64 %121, 0
  br i1 %122, label %123, label %127

123:                                              ; preds = %114
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.MDBX_txn, ptr %124, i32 0, i32 9
  %126 = load ptr, ptr %125, align 8, !tbaa !20
  call void @mdbx_assert_fail(ptr noundef %126, ptr noundef @.str.3, ptr noundef @__func__.mdbx_cmp, i32 noundef 108) #4
  unreachable

127:                                              ; preds = %114
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128, %81
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.MDBX_txn, ptr %131, i32 0, i32 9
  %133 = load ptr, ptr %132, align 8, !tbaa !20
  %134 = getelementptr inbounds %struct.MDBX_env, ptr %133, i32 0, i32 25
  %135 = load ptr, ptr %134, align 8, !tbaa !32
  %136 = load i32, ptr %6, align 4, !tbaa !9
  %137 = zext i32 %136 to i64
  %138 = getelementptr inbounds %struct.kvx, ptr %135, i64 %137
  %139 = getelementptr inbounds %struct.kvx, ptr %138, i32 0, i32 0
  %140 = getelementptr inbounds %struct.clc2, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds %struct.clc, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !33
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = call i32 %142(ptr noundef %143, ptr noundef %144)
  ret i32 %145
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i8 @dbi_state(ptr noundef, i64 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @dbi_changed(ptr noundef, i64 noundef) #3

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 = { 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 25}
!12 = !{!"libmdbx_globals", !7, i64 0, !10, i64 16, !10, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !13, i64 27, !10, i64 28, !7, i64 32, !7, i64 40, !14, i64 80, !6, i64 88}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"MDBX_txn", !10, i64 0, !10, i64 4, !14, i64 8, !14, i64 16, !6, i64 24, !6, i64 32, !17, i64 40, !14, i64 64, !14, 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, !10, i64 4, !10, i64 8, !7, i64 12, !7, i64 16}
!18 = !{!"short", !7, i64 0}
!19 = !{!"MDBX_canary", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!20 = !{!16, !6, i64 80}
!21 = !{!22, !10, i64 440}
!22 = !{!"MDBX_env", !7, i64 0, !10, i64 4, !10, i64 8, !23, i64 16, !10, i64 56, !10, i64 60, !23, i64 64, !6, i64 104, !18, i64 112, !18, i64 114, !18, i64 116, !18, i64 118, !18, i64 120, !18, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !18, i64 130, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !24, i64 152, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !10, i64 228, !10, i64 232, !6, i64 240, !6, i64 248, !14, i64 256, !25, i64 264, !27, i64 320, !13, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !28, i64 392, !7, i64 400, !10, i64 440, !10, i64 444, !6, i64 448, !29, i64 456, !7, i64 496, !7, i64 536}
!23 = !{!"osal_mmap", !7, i64 0, !10, i64 8, !14, i64 16, !14, i64 24, !14, i64 32}
!24 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!25 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !14, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !10, i64 28, !10, i64 32, !13, i64 36, !13, i64 37, !13, i64 38, !26, i64 40, !7, i64 48}
!26 = !{!"", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6}
!27 = !{!"", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32}
!28 = !{!"", !14, i64 0}
!29 = !{!"osal_ioring", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!30 = !{!22, !6, i64 208}
!31 = !{!7, !7, i64 0}
!32 = !{!22, !6, i64 200}
!33 = !{!34, !6, i64 0}
!34 = !{!"kvx", !35, i64 0, !37, i64 48}
!35 = !{!"clc2", !36, i64 0, !36, i64 24}
!36 = !{!"clc", !6, i64 0, !14, i64 8, !14, i64 16}
!37 = !{!"iovec", !6, i64 0, !14, i64 8}


; 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.kvx = type { %struct.clc2, %struct.iovec }
%struct.clc2 = type { %struct.clc, %struct.clc }
%struct.clc = type { ptr, i64, i64 }
%struct.iovec = type { ptr, i64 }

@globals = external local_unnamed_addr global %struct.libmdbx_globals, align 8
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@__func__.mdbx_cmp = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [68 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: mustprogress nofree nounwind willreturn memory(read) uwtable
define dso_local i32 @mdbx_cmp(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !5
  %6 = and i8 %5, 1
  %.not = icmp eq i8 %6, 0
  br i1 %.not, label %.thread, label %7, !prof !13

7:                                                ; preds = %4
  %8 = load i32, ptr %0, align 8, !tbaa !14
  %.not14 = icmp eq i32 %8, 332741169
  br i1 %.not14, label %10, label %9, !prof !19

9:                                                ; preds = %7
  tail call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.mdbx_cmp, i32 noundef 106) #3
  unreachable

10:                                               ; preds = %7
  %11 = zext i32 %1 to i64
  %12 = tail call zeroext i8 @dbi_state(ptr noundef nonnull %0, i64 noundef %11)
  %13 = and i8 %12, 16
  %.not16 = icmp eq i8 %13, 0
  br i1 %.not16, label %.critedge, label %14, !prof !13

14:                                               ; preds = %10
  %15 = tail call zeroext i1 @dbi_changed(ptr noundef nonnull %0, i64 noundef %11)
  br i1 %15, label %.critedge, label %..thread_crit_edge, !prof !13

..thread_crit_edge:                               ; preds = %14
  %.pre = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !5
  br label %.thread

.critedge:                                        ; preds = %10, %14
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = load ptr, ptr %16, align 8, !tbaa !20
  tail call void @mdbx_assert_fail(ptr noundef %17, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.mdbx_cmp, i32 noundef 107) #3
  unreachable

.thread:                                          ; preds = %..thread_crit_edge, %4
  %18 = phi i8 [ %.pre, %..thread_crit_edge ], [ %5, %4 ]
  %19 = and i8 %18, 1
  %.not17 = icmp eq i8 %19, 0
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 80
  %.pre20 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !20
  br i1 %.not17, label %.thread._crit_edge, label %20, !prof !13

.thread._crit_edge:                               ; preds = %.thread
  %.pre21 = zext i32 %1 to i64
  br label %31

20:                                               ; preds = %.thread
  %21 = getelementptr inbounds i8, ptr %.pre20, i64 440
  %22 = load i32, ptr %21, align 8, !tbaa !21
  %23 = icmp ugt i32 %22, %1
  br i1 %23, label %24, label %.critedge19, !prof !19

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %.pre20, i64 208
  %26 = load ptr, ptr %25, align 8, !tbaa !30
  %27 = zext i32 %1 to i64
  %28 = getelementptr inbounds i8, ptr %26, i64 %27
  %29 = load i8, ptr %28, align 1, !tbaa !31
  %30 = icmp sgt i8 %29, -1
  br i1 %30, label %.critedge19, label %31, !prof !13

.critedge19:                                      ; preds = %20, %24
  tail call void @mdbx_assert_fail(ptr noundef nonnull %.pre20, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.mdbx_cmp, i32 noundef 108) #3
  unreachable

31:                                               ; preds = %.thread._crit_edge, %24
  %.pre-phi = phi i64 [ %.pre21, %.thread._crit_edge ], [ %27, %24 ]
  %32 = getelementptr inbounds i8, ptr %.pre20, i64 200
  %33 = load ptr, ptr %32, align 8, !tbaa !32
  %34 = getelementptr inbounds %struct.kvx, ptr %33, i64 %.pre-phi
  %35 = load ptr, ptr %34, align 8, !tbaa !33
  %36 = tail call i32 %35(ptr noundef %2, ptr noundef %3) #4
  ret i32 %36
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i8 @dbi_state(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @dbi_changed(ptr noundef, i64 noundef) local_unnamed_addr #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 = { 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 #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind }
attributes #4 = { 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 = !{!15, !9, i64 0}
!15 = !{!"MDBX_txn", !9, i64 0, !9, i64 4, !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 32, !16, 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, !18, i64 128, !12, i64 160, !7, i64 168}
!16 = !{!"geo", !17, i64 0, !17, i64 2, !9, i64 4, !9, i64 8, !7, i64 12, !7, i64 16}
!17 = !{!"short", !7, i64 0}
!18 = !{!"MDBX_canary", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!19 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!20 = !{!15, !12, i64 80}
!21 = !{!22, !9, i64 440}
!22 = !{!"MDBX_env", !7, i64 0, !9, i64 4, !9, i64 8, !23, i64 16, !9, i64 56, !9, i64 60, !23, i64 64, !12, i64 104, !17, i64 112, !17, i64 114, !17, i64 116, !17, i64 118, !17, i64 120, !17, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !17, i64 130, !9, i64 132, !9, i64 136, !9, i64 140, !9, i64 144, !24, i64 152, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !9, i64 224, !9, i64 228, !9, i64 232, !12, i64 240, !12, i64 248, !11, i64 256, !25, i64 264, !27, i64 320, !10, i64 360, !12, i64 368, !12, i64 376, !12, i64 384, !28, i64 392, !7, i64 400, !9, i64 440, !9, i64 444, !12, i64 448, !29, i64 456, !7, i64 496, !7, i64 536}
!23 = !{!"osal_mmap", !7, i64 0, !9, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!24 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!25 = !{!"", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !11, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !9, i64 28, !9, i64 32, !10, i64 36, !10, i64 37, !10, i64 38, !26, i64 40, !7, i64 48}
!26 = !{!"", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6}
!27 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!28 = !{!"", !11, i64 0}
!29 = !{!"osal_ioring", !9, i64 0, !9, i64 4, !9, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!30 = !{!22, !12, i64 208}
!31 = !{!7, !7, i64 0}
!32 = !{!22, !12, i64 200}
!33 = !{!34, !12, i64 0}
!34 = !{!"kvx", !35, i64 0, !37, i64 48}
!35 = !{!"clc2", !36, i64 0, !36, i64 24}
!36 = !{!"clc", !12, i64 0, !11, i64 8, !11, i64 16}
!37 = !{!"iovec", !12, i64 0, !11, i64 8}


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