; LLVM IR from erthink/libmdbx :: src/tools (stat)

; 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.MDBX_version_info = type { i16, i16, i16, i16, ptr, %struct.anon.4, ptr }
%struct.anon.4 = type { ptr, ptr, ptr, ptr }
%struct.MDBX_build_info = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.MDBX_envinfo = type { %struct.anon, i64, i64, i64, i64, i64, [3 x i64], [3 x i64], i32, i32, i32, i32, %struct.anon.0, i64, i64, i32, i32, i32, i32, %struct.anon.2, %struct.anon.3 }
%struct.anon = type { i64, i64, i64, i64, i64 }
%struct.anon.0 = type { %struct.anon.1, [3 x %struct.anon.1] }
%struct.anon.1 = type { i64, i64 }
%struct.anon.2 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.anon.3 = type { i64, i64 }
%struct.MDBX_stat = type { i32, i32, i64, i64, i64, i64, i64 }
%struct.iovec = type { ptr, i64 }

@quiet = external dso_local global i8, align 1
@prog = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [136 x i8], align 1
@mdbx_version = external constant %struct.MDBX_version_info, align 8
@mdbx_sourcery_MDBX_BUILD_SOURCERY = external constant ptr, align 8
@mdbx_build = external constant %struct.MDBX_build_info, align 8
@optarg = external global ptr, align 8
@optind = external global i32, align 4
@.str.2 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [14 x i8], align 1
@user_break = external hidden global i32, align 4
@.str.40 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [10 x i8], align 1
@stderr = external global ptr, align 8
@.str.45 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.MDBX_envinfo, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca %struct.MDBX_stat, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca %struct.iovec, align 8
  %27 = alloca %struct.iovec, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i64, align 8
  %37 = alloca double, align 8
  %38 = alloca %struct.MDBX_stat, align 8
  %39 = alloca ptr, align 8
  %40 = alloca %struct.iovec, align 8
  %41 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.start.p0(i64 352, ptr %11) #10
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds ptr, ptr %42, i64 0
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  store ptr %44, ptr @prog, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #10
  store i8 0, ptr %14, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #10
  store i8 0, ptr %15, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #10
  store i8 0, ptr %16, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  store i32 0, ptr %18, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = icmp slt i32 %45, 2
  br i1 %46, label %47, label %49

47:                                               ; preds = %2
  %48 = load ptr, ptr @prog, align 8, !tbaa !9
  call void @usage(ptr noundef %48)
  br label %49

49:                                               ; preds = %47, %2
  br label %50

50:                                               ; preds = %101, %49
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !9
  %53 = call i32 @getopt(i32 noundef %51, ptr noundef %52, ptr noundef @.str) #10
  store i32 %53, ptr %6, align 4, !tbaa !5
  %54 = icmp ne i32 %53, -1
  br i1 %54, label %55, label %102

55:                                               ; preds = %50
  %56 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %56, label %99 [
    i32 86, label %57
    i32 113, label %77
    i32 112, label %78
    i32 97, label %79
    i32 101, label %85
    i32 102, label %86
    i32 110, label %101
    i32 114, label %89
    i32 115, label %92
  ]

57:                                               ; preds = %55
  %58 = load i16, ptr @mdbx_version, align 8, !tbaa !13
  %59 = zext i16 %58 to i32
  %60 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 1), align 2, !tbaa !17
  %61 = zext i16 %60 to i32
  %62 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 2), align 4, !tbaa !18
  %63 = zext i16 %62 to i32
  %64 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 3), align 2, !tbaa !19
  %65 = zext i16 %64 to i32
  %66 = load ptr, ptr getelementptr inbounds (%struct.anon.4, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 3), align 8, !tbaa !20
  %67 = load ptr, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), align 8, !tbaa !21
  %68 = load ptr, ptr getelementptr inbounds (%struct.anon.4, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 2), align 8, !tbaa !22
  %69 = load ptr, ptr getelementptr inbounds (%struct.anon.4, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 1), align 8, !tbaa !23
  %70 = load ptr, ptr @mdbx_sourcery_MDBX_BUILD_SOURCERY, align 8, !tbaa !9
  %71 = load ptr, ptr @mdbx_build, align 8, !tbaa !24
  %72 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 1), align 8, !tbaa !26
  %73 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 3), align 8, !tbaa !27
  %74 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 4), align 8, !tbaa !28
  %75 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 2), align 8, !tbaa !29
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %59, i32 noundef %61, i32 noundef %63, i32 noundef %65, ptr noundef %66, ptr noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef %70, ptr noundef %71, ptr noundef %72, ptr noundef %73, ptr noundef %74, ptr noundef %75)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %937

77:                                               ; preds = %55
  store i8 1, ptr @quiet, align 1, !tbaa !11
  br label %101

78:                                               ; preds = %55
  store i8 1, ptr %16, align 1, !tbaa !11
  br label %101

79:                                               ; preds = %55
  %80 = load ptr, ptr %13, align 8, !tbaa !9
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %84

82:                                               ; preds = %79
  %83 = load ptr, ptr @prog, align 8, !tbaa !9
  call void @usage(ptr noundef %83)
  br label %84

84:                                               ; preds = %82, %79
  store i8 1, ptr %14, align 1, !tbaa !11
  br label %101

85:                                               ; preds = %55
  store i8 1, ptr %15, align 1, !tbaa !11
  br label %101

86:                                               ; preds = %55
  %87 = load i32, ptr %17, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %17, align 4, !tbaa !5
  br label %101

89:                                               ; preds = %55
  %90 = load i32, ptr %18, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %18, align 4, !tbaa !5
  br label %101

92:                                               ; preds = %55
  %93 = load i8, ptr %14, align 1, !tbaa !11, !range !30, !noundef !31
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %97

95:                                               ; preds = %92
  %96 = load ptr, ptr @prog, align 8, !tbaa !9
  call void @usage(ptr noundef %96)
  br label %97

97:                                               ; preds = %95, %92
  %98 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %98, ptr %13, align 8, !tbaa !9
  br label %101

99:                                               ; preds = %55
  %100 = load ptr, ptr @prog, align 8, !tbaa !9
  call void @usage(ptr noundef %100)
  br label %101

101:                                              ; preds = %99, %97, %89, %86, %85, %84, %78, %77, %55
  br label %50, !llvm.loop !32

102:                                              ; preds = %50
  %103 = load i32, ptr @optind, align 4, !tbaa !5
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = icmp ne i32 %103, %105
  br i1 %106, label %107, label %109

107:                                              ; preds = %102
  %108 = load ptr, ptr @prog, align 8, !tbaa !9
  call void @usage(ptr noundef %108)
  br label %109

109:                                              ; preds = %107, %102
  %110 = call ptr @signal(i32 noundef 13, ptr noundef @signal_handler) #10
  %111 = call ptr @signal(i32 noundef 1, ptr noundef @signal_handler) #10
  %112 = call ptr @signal(i32 noundef 2, ptr noundef @signal_handler) #10
  %113 = call ptr @signal(i32 noundef 15, ptr noundef @signal_handler) #10
  %114 = load ptr, ptr %5, align 8, !tbaa !9
  %115 = load i32, ptr @optind, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds ptr, ptr %114, i64 %116
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  store ptr %118, ptr %12, align 8, !tbaa !9
  %119 = load ptr, ptr %5, align 8, !tbaa !9
  %120 = load i32, ptr @optind, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds ptr, ptr %119, i64 %121
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  store ptr %123, ptr %12, align 8, !tbaa !9
  %124 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %125 = trunc i8 %124 to i1
  br i1 %125, label %134, label %126

126:                                              ; preds = %109
  %127 = load ptr, ptr getelementptr inbounds (%struct.anon.4, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 3), align 8, !tbaa !20
  %128 = load ptr, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), align 8, !tbaa !21
  %129 = load ptr, ptr getelementptr inbounds (%struct.anon.4, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 1), align 8, !tbaa !23
  %130 = load ptr, ptr %12, align 8, !tbaa !9
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %127, ptr noundef %128, ptr noundef %129, ptr noundef %130)
  %132 = call i32 @fflush(ptr noundef null)
  %133 = call i32 @mdbx_setup_debug(i32 noundef 3, i32 noundef -1, ptr noundef @logger)
  br label %134

134:                                              ; preds = %126, %109
  %135 = call i32 @mdbx_env_create(ptr noundef %8)
  store i32 %135, ptr %7, align 4, !tbaa !5
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = icmp ne i32 %136, 0
  %138 = xor i1 %137, true
  %139 = xor i1 %138, true
  %140 = zext i1 %139 to i32
  %141 = sext i32 %140 to i64
  %142 = call i64 @llvm.expect.i64(i64 %141, i64 0)
  %143 = icmp ne i64 %142, 0
  br i1 %143, label %144, label %146

144:                                              ; preds = %134
  %145 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.3, i32 noundef %145)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %937

146:                                              ; preds = %134
  %147 = load i8, ptr %14, align 1, !tbaa !11, !range !30, !noundef !31
  %148 = trunc i8 %147 to i1
  br i1 %148, label %152, label %149

149:                                              ; preds = %146
  %150 = load ptr, ptr %13, align 8, !tbaa !9
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %166

152:                                              ; preds = %149, %146
  %153 = load ptr, ptr %8, align 8, !tbaa !9
  %154 = call i32 @mdbx_env_set_maxdbs(ptr noundef %153, i32 noundef 2)
  store i32 %154, ptr %7, align 4, !tbaa !5
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %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 0)
  %162 = icmp ne i64 %161, 0
  br i1 %162, label %163, label %165

163:                                              ; preds = %152
  %164 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.4, i32 noundef %164)
  br label %930

165:                                              ; preds = %152
  br label %166

166:                                              ; preds = %165, %149
  %167 = load ptr, ptr %8, align 8, !tbaa !9
  %168 = load ptr, ptr %12, align 8, !tbaa !9
  %169 = call i32 @mdbx_env_open(ptr noundef %167, ptr noundef %168, i32 noundef 131072, i32 noundef 0)
  store i32 %169, ptr %7, align 4, !tbaa !5
  %170 = load i32, ptr %7, align 4, !tbaa !5
  %171 = icmp ne i32 %170, 0
  %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 %180

178:                                              ; preds = %166
  %179 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.5, i32 noundef %179)
  br label %930

180:                                              ; preds = %166
  %181 = load ptr, ptr %8, align 8, !tbaa !9
  %182 = call i32 @mdbx_txn_begin(ptr noundef %181, ptr noundef null, i32 noundef 131072, ptr noundef %9)
  store i32 %182, ptr %7, align 4, !tbaa !5
  %183 = load i32, ptr %7, align 4, !tbaa !5
  %184 = icmp ne i32 %183, 0
  %185 = xor i1 %184, true
  %186 = xor i1 %185, true
  %187 = zext i1 %186 to i32
  %188 = sext i32 %187 to i64
  %189 = call i64 @llvm.expect.i64(i64 %188, i64 0)
  %190 = icmp ne i64 %189, 0
  br i1 %190, label %191, label %193

191:                                              ; preds = %180
  %192 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.6, i32 noundef %192)
  br label %927

193:                                              ; preds = %180
  %194 = load i8, ptr %15, align 1, !tbaa !11, !range !30, !noundef !31
  %195 = trunc i8 %194 to i1
  br i1 %195, label %202, label %196

196:                                              ; preds = %193
  %197 = load i32, ptr %17, align 4, !tbaa !5
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %202, label %199

199:                                              ; preds = %196
  %200 = load i8, ptr %16, align 1, !tbaa !11, !range !30, !noundef !31
  %201 = trunc i8 %200 to i1
  br i1 %201, label %202, label %217

202:                                              ; preds = %199, %196, %193
  %203 = load ptr, ptr %8, align 8, !tbaa !9
  %204 = load ptr, ptr %9, align 8, !tbaa !9
  %205 = call i32 @mdbx_env_info_ex(ptr noundef %203, ptr noundef %204, ptr noundef %11, i64 noundef 352)
  store i32 %205, ptr %7, align 4, !tbaa !5
  %206 = load i32, ptr %7, align 4, !tbaa !5
  %207 = icmp ne i32 %206, 0
  %208 = xor i1 %207, true
  %209 = xor i1 %208, true
  %210 = zext i1 %209 to i32
  %211 = sext i32 %210 to i64
  %212 = call i64 @llvm.expect.i64(i64 %211, i64 0)
  %213 = icmp ne i64 %212, 0
  br i1 %213, label %214, label %216

214:                                              ; preds = %202
  %215 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.7, i32 noundef %215)
  br label %927

216:                                              ; preds = %202
  br label %218

217:                                              ; preds = %199
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 352, i1 false)
  br label %218

218:                                              ; preds = %217, %216
  %219 = load i8, ptr %16, align 1, !tbaa !11, !range !30, !noundef !31
  %220 = trunc i8 %219 to i1
  br i1 %220, label %221, label %271

221:                                              ; preds = %218
  %222 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %223 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %224 = getelementptr inbounds %struct.anon.2, ptr %223, i32 0, i32 0
  %225 = load i64, ptr %224, align 8, !tbaa !34
  %226 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %225)
  %227 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %228 = getelementptr inbounds %struct.anon.2, ptr %227, i32 0, i32 1
  %229 = load i64, ptr %228, align 8, !tbaa !41
  %230 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i64 noundef %229)
  %231 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %232 = getelementptr inbounds %struct.anon.2, ptr %231, i32 0, i32 2
  %233 = load i64, ptr %232, align 8, !tbaa !42
  %234 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i64 noundef %233)
  %235 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %236 = getelementptr inbounds %struct.anon.2, ptr %235, i32 0, i32 3
  %237 = load i64, ptr %236, align 8, !tbaa !43
  %238 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i64 noundef %237)
  %239 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %240 = getelementptr inbounds %struct.anon.2, ptr %239, i32 0, i32 4
  %241 = load i64, ptr %240, align 8, !tbaa !44
  %242 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i64 noundef %241)
  %243 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %244 = getelementptr inbounds %struct.anon.2, ptr %243, i32 0, i32 5
  %245 = load i64, ptr %244, align 8, !tbaa !45
  %246 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i64 noundef %245)
  %247 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %248 = getelementptr inbounds %struct.anon.2, ptr %247, i32 0, i32 6
  %249 = load i64, ptr %248, align 8, !tbaa !46
  %250 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i64 noundef %249)
  %251 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %252 = getelementptr inbounds %struct.anon.2, ptr %251, i32 0, i32 7
  %253 = load i64, ptr %252, align 8, !tbaa !47
  %254 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i64 noundef %253)
  %255 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %256 = getelementptr inbounds %struct.anon.2, ptr %255, i32 0, i32 8
  %257 = load i64, ptr %256, align 8, !tbaa !48
  %258 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, i64 noundef %257)
  %259 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %260 = getelementptr inbounds %struct.anon.2, ptr %259, i32 0, i32 9
  %261 = load i64, ptr %260, align 8, !tbaa !49
  %262 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, i64 noundef %261)
  %263 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %264 = getelementptr inbounds %struct.anon.2, ptr %263, i32 0, i32 10
  %265 = load i64, ptr %264, align 8, !tbaa !50
  %266 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, i64 noundef %265)
  %267 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 19
  %268 = getelementptr inbounds %struct.anon.2, ptr %267, i32 0, i32 11
  %269 = load i64, ptr %268, align 8, !tbaa !51
  %270 = call i32 (ptr, ...) @printf(ptr noundef @.str.20, i64 noundef %269)
  br label %271

271:                                              ; preds = %221, %218
  %272 = load i8, ptr %15, align 1, !tbaa !11, !range !30, !noundef !31
  %273 = trunc i8 %272 to i1
  br i1 %273, label %274, label %378

274:                                              ; preds = %271
  %275 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  %276 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %277 = load i32, ptr %276, align 8, !tbaa !52
  %278 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, i32 noundef %277)
  %279 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %280 = getelementptr inbounds %struct.anon, ptr %279, i32 0, i32 0
  %281 = load i64, ptr %280, align 8, !tbaa !53
  %282 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %283 = getelementptr inbounds %struct.anon, ptr %282, i32 0, i32 1
  %284 = load i64, ptr %283, align 8, !tbaa !54
  %285 = icmp ne i64 %281, %284
  br i1 %285, label %286, label %348

286:                                              ; preds = %274
  %287 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %288 = getelementptr inbounds %struct.anon, ptr %287, i32 0, i32 0
  %289 = load i64, ptr %288, align 8, !tbaa !53
  %290 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %291 = getelementptr inbounds %struct.anon, ptr %290, i32 0, i32 1
  %292 = load i64, ptr %291, align 8, !tbaa !54
  %293 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %294 = getelementptr inbounds %struct.anon, ptr %293, i32 0, i32 4
  %295 = load i64, ptr %294, align 8, !tbaa !55
  %296 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %297 = getelementptr inbounds %struct.anon, ptr %296, i32 0, i32 3
  %298 = load i64, ptr %297, align 8, !tbaa !56
  %299 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %300 = getelementptr inbounds %struct.anon, ptr %299, i32 0, i32 0
  %301 = load i64, ptr %300, align 8, !tbaa !53
  %302 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %303 = load i32, ptr %302, align 8, !tbaa !52
  %304 = zext i32 %303 to i64
  %305 = udiv i64 %301, %304
  %306 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %307 = getelementptr inbounds %struct.anon, ptr %306, i32 0, i32 1
  %308 = load i64, ptr %307, align 8, !tbaa !54
  %309 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %310 = load i32, ptr %309, align 8, !tbaa !52
  %311 = zext i32 %310 to i64
  %312 = udiv i64 %308, %311
  %313 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %314 = getelementptr inbounds %struct.anon, ptr %313, i32 0, i32 4
  %315 = load i64, ptr %314, align 8, !tbaa !55
  %316 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %317 = load i32, ptr %316, align 8, !tbaa !52
  %318 = zext i32 %317 to i64
  %319 = udiv i64 %315, %318
  %320 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %321 = getelementptr inbounds %struct.anon, ptr %320, i32 0, i32 3
  %322 = load i64, ptr %321, align 8, !tbaa !56
  %323 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %324 = load i32, ptr %323, align 8, !tbaa !52
  %325 = zext i32 %324 to i64
  %326 = udiv i64 %322, %325
  %327 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, i64 noundef %289, i64 noundef %292, i64 noundef %295, i64 noundef %298, i64 noundef %305, i64 noundef %312, i64 noundef %319, i64 noundef %326)
  %328 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 1
  %329 = load i64, ptr %328, align 8, !tbaa !57
  %330 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 1
  %331 = load i64, ptr %330, align 8, !tbaa !57
  %332 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %333 = load i32, ptr %332, align 8, !tbaa !52
  %334 = zext i32 %333 to i64
  %335 = udiv i64 %331, %334
  %336 = call i32 (ptr, ...) @printf(ptr noundef @.str.24, i64 noundef %329, i64 noundef %335)
  %337 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %338 = getelementptr inbounds %struct.anon, ptr %337, i32 0, i32 2
  %339 = load i64, ptr %338, align 8, !tbaa !58
  %340 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %341 = getelementptr inbounds %struct.anon, ptr %340, i32 0, i32 2
  %342 = load i64, ptr %341, align 8, !tbaa !58
  %343 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %344 = load i32, ptr %343, align 8, !tbaa !52
  %345 = zext i32 %344 to i64
  %346 = udiv i64 %342, %345
  %347 = call i32 (ptr, ...) @printf(ptr noundef @.str.25, i64 noundef %339, i64 noundef %346)
  br label %360

348:                                              ; preds = %274
  %349 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %350 = getelementptr inbounds %struct.anon, ptr %349, i32 0, i32 2
  %351 = load i64, ptr %350, align 8, !tbaa !58
  %352 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %353 = getelementptr inbounds %struct.anon, ptr %352, i32 0, i32 2
  %354 = load i64, ptr %353, align 8, !tbaa !58
  %355 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %356 = load i32, ptr %355, align 8, !tbaa !52
  %357 = zext i32 %356 to i64
  %358 = udiv i64 %354, %357
  %359 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, i64 noundef %351, i64 noundef %358)
  br label %360

360:                                              ; preds = %348, %286
  %361 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 3
  %362 = load i64, ptr %361, align 8, !tbaa !59
  %363 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, i64 noundef %362)
  %364 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 4
  %365 = load i64, ptr %364, align 8, !tbaa !60
  %366 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 4
  %367 = load i64, ptr %366, align 8, !tbaa !60
  %368 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 3
  %369 = load i64, ptr %368, align 8, !tbaa !59
  %370 = sub i64 %367, %369
  %371 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, i64 noundef %365, i64 noundef %370)
  %372 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 8
  %373 = load i32, ptr %372, align 8, !tbaa !61
  %374 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, i32 noundef %373)
  %375 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 9
  %376 = load i32, ptr %375, align 4, !tbaa !62
  %377 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, i32 noundef %376)
  br label %378

378:                                              ; preds = %360, %271
  %379 = load i32, ptr %18, align 4, !tbaa !5
  %380 = icmp ne i32 %379, 0
  br i1 %380, label %381, label %443

381:                                              ; preds = %378
  %382 = load ptr, ptr %8, align 8, !tbaa !9
  %383 = call i32 @mdbx_reader_list(ptr noundef %382, ptr noundef @reader_list_func, ptr noundef null)
  store i32 %383, ptr %7, align 4, !tbaa !5
  %384 = load i32, ptr %7, align 4, !tbaa !5
  %385 = icmp ne i32 %384, -1
  br i1 %385, label %386, label %391

386:                                              ; preds = %381
  %387 = load i32, ptr %7, align 4, !tbaa !5
  %388 = icmp ne i32 %387, 0
  br i1 %388, label %389, label %391

389:                                              ; preds = %386
  %390 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.31, i32 noundef %390)
  br label %927

391:                                              ; preds = %386, %381
  %392 = load i32, ptr %7, align 4, !tbaa !5
  %393 = icmp eq i32 %392, -1
  br i1 %393, label %394, label %396

394:                                              ; preds = %391
  %395 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  br label %432

396:                                              ; preds = %391
  %397 = load i32, ptr %7, align 4, !tbaa !5
  %398 = icmp eq i32 %397, 0
  br i1 %398, label %399, label %431

399:                                              ; preds = %396
  %400 = load i32, ptr %18, align 4, !tbaa !5
  %401 = icmp sgt i32 %400, 1
  br i1 %401, label %402, label %431

402:                                              ; preds = %399
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  %403 = load ptr, ptr %8, align 8, !tbaa !9
  %404 = call i32 @mdbx_reader_check(ptr noundef %403, ptr noundef %20)
  store i32 %404, ptr %7, align 4, !tbaa !5
  %405 = load i32, ptr %7, align 4, !tbaa !5
  %406 = icmp ne i32 %405, -1
  br i1 %406, label %407, label %412

407:                                              ; preds = %402
  %408 = load i32, ptr %7, align 4, !tbaa !5
  %409 = icmp ne i32 %408, 0
  br i1 %409, label %410, label %412

410:                                              ; preds = %407
  %411 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.33, i32 noundef %411)
  store i32 6, ptr %19, align 4
  br label %428

412:                                              ; preds = %407, %402
  %413 = load i32, ptr %7, align 4, !tbaa !5
  %414 = icmp eq i32 %413, -1
  br i1 %414, label %415, label %425

415:                                              ; preds = %412
  %416 = load i32, ptr %20, align 4, !tbaa !5
  %417 = call i32 (ptr, ...) @printf(ptr noundef @.str.34, i32 noundef %416)
  %418 = load ptr, ptr %8, align 8, !tbaa !9
  %419 = call i32 @mdbx_reader_list(ptr noundef %418, ptr noundef @reader_list_func, ptr noundef null)
  store i32 %419, ptr %7, align 4, !tbaa !5
  %420 = load i32, ptr %7, align 4, !tbaa !5
  %421 = icmp eq i32 %420, -1
  br i1 %421, label %422, label %424

422:                                              ; preds = %415
  %423 = call i32 (ptr, ...) @printf(ptr noundef @.str.35)
  br label %424

424:                                              ; preds = %422, %415
  br label %427

425:                                              ; preds = %412
  %426 = call i32 (ptr, ...) @printf(ptr noundef @.str.36)
  br label %427

427:                                              ; preds = %425, %424
  store i32 0, ptr %19, align 4
  br label %428

428:                                              ; preds = %427, %410
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  %429 = load i32, ptr %19, align 4
  switch i32 %429, label %937 [
    i32 0, label %430
    i32 6, label %927
  ]

430:                                              ; preds = %428
  br label %431

431:                                              ; preds = %430, %399, %396
  br label %432

432:                                              ; preds = %431, %394
  %433 = load ptr, ptr %13, align 8, !tbaa !9
  %434 = icmp ne ptr %433, null
  br i1 %434, label %442, label %435

435:                                              ; preds = %432
  %436 = load i8, ptr %14, align 1, !tbaa !11, !range !30, !noundef !31
  %437 = trunc i8 %436 to i1
  br i1 %437, label %442, label %438

438:                                              ; preds = %435
  %439 = load i32, ptr %17, align 4, !tbaa !5
  %440 = icmp ne i32 %439, 0
  br i1 %440, label %442, label %441

441:                                              ; preds = %438
  br label %927

442:                                              ; preds = %438, %435, %432
  br label %443

443:                                              ; preds = %442, %378
  %444 = load i32, ptr %17, align 4, !tbaa !5
  %445 = icmp ne i32 %444, 0
  br i1 %445, label %446, label %759

446:                                              ; preds = %443
  %447 = call i32 (ptr, ...) @printf(ptr noundef @.str.37)
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #10
  %448 = load ptr, ptr %9, align 8, !tbaa !9
  %449 = load i32, ptr %10, align 4, !tbaa !5
  %450 = call i32 @mdbx_cursor_open(ptr noundef %448, i32 noundef %449, ptr noundef %21)
  store i32 %450, ptr %7, align 4, !tbaa !5
  %451 = load i32, ptr %7, align 4, !tbaa !5
  %452 = icmp ne i32 %451, 0
  %453 = xor i1 %452, true
  %454 = xor i1 %453, true
  %455 = zext i1 %454 to i32
  %456 = sext i32 %455 to i64
  %457 = call i64 @llvm.expect.i64(i64 %456, i64 0)
  %458 = icmp ne i64 %457, 0
  br i1 %458, label %459, label %461

459:                                              ; preds = %446
  %460 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.38, i32 noundef %460)
  store i32 6, ptr %19, align 4
  br label %756

461:                                              ; preds = %446
  call void @llvm.lifetime.start.p0(i64 48, ptr %22) #10
  %462 = load ptr, ptr %9, align 8, !tbaa !9
  %463 = load i32, ptr %10, align 4, !tbaa !5
  %464 = call i32 @mdbx_dbi_stat(ptr noundef %462, i32 noundef %463, ptr noundef %22, i64 noundef 48)
  store i32 %464, ptr %7, align 4, !tbaa !5
  %465 = load i32, ptr %7, align 4, !tbaa !5
  %466 = icmp ne i32 %465, 0
  %467 = xor i1 %466, true
  %468 = xor i1 %467, true
  %469 = zext i1 %468 to i32
  %470 = sext i32 %469 to i64
  %471 = call i64 @llvm.expect.i64(i64 %470, i64 0)
  %472 = icmp ne i64 %471, 0
  br i1 %472, label %473, label %475

473:                                              ; preds = %461
  %474 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.39, i32 noundef %474)
  store i32 6, ptr %19, align 4
  br label %755

475:                                              ; preds = %461
  call void @print_stat(ptr noundef %22)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  store i32 0, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #10
  br label %476

476:                                              ; preds = %625, %475
  %477 = load ptr, ptr %21, align 8, !tbaa !9
  %478 = call i32 @mdbx_cursor_get(ptr noundef %477, ptr noundef %26, ptr noundef %27, i32 noundef 8)
  store i32 %478, ptr %7, align 4, !tbaa !5
  %479 = icmp eq i32 0, %478
  br i1 %479, label %480, label %626

480:                                              ; preds = %476
  %481 = load volatile i32, ptr @user_break, align 4, !tbaa !5
  %482 = icmp ne i32 %481, 0
  br i1 %482, label %483, label %484

483:                                              ; preds = %480
  store i32 4, ptr %7, align 4, !tbaa !5
  br label %626

484:                                              ; preds = %480
  %485 = getelementptr inbounds %struct.iovec, ptr %27, i32 0, i32 0
  %486 = load ptr, ptr %485, align 8, !tbaa !63
  store ptr %486, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #10
  %487 = load ptr, ptr %24, align 8, !tbaa !9
  %488 = getelementptr inbounds i32, ptr %487, i32 1
  store ptr %488, ptr %24, align 8, !tbaa !9
  %489 = load i32, ptr %487, align 4, !tbaa !5
  store i32 %489, ptr %28, align 4, !tbaa !5
  %490 = load i32, ptr %28, align 4, !tbaa !5
  %491 = load i32, ptr %23, align 4, !tbaa !5
  %492 = add i32 %491, %490
  store i32 %492, ptr %23, align 4, !tbaa !5
  %493 = load i8, ptr %15, align 1, !tbaa !11, !range !30, !noundef !31
  %494 = trunc i8 %493 to i1
  br i1 %494, label %495, label %506

495:                                              ; preds = %484
  %496 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 4
  %497 = load i64, ptr %496, align 8, !tbaa !60
  %498 = getelementptr inbounds %struct.iovec, ptr %26, i32 0, i32 0
  %499 = load ptr, ptr %498, align 8, !tbaa !63
  %500 = load i64, ptr %499, align 8, !tbaa !65
  %501 = icmp ugt i64 %497, %500
  br i1 %501, label %502, label %506

502:                                              ; preds = %495
  %503 = load i32, ptr %28, align 4, !tbaa !5
  %504 = load i32, ptr %25, align 4, !tbaa !5
  %505 = add i32 %504, %503
  store i32 %505, ptr %25, align 4, !tbaa !5
  br label %506

506:                                              ; preds = %502, %495, %484
  %507 = load i32, ptr %17, align 4, !tbaa !5
  %508 = icmp sgt i32 %507, 1
  br i1 %508, label %509, label %625

509:                                              ; preds = %506
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #10
  store ptr @.str.40, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #10
  %510 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 2
  %511 = load i64, ptr %510, align 8, !tbaa !66
  %512 = trunc i64 %511 to i32
  %513 = add i32 %512, 1
  store i32 %513, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #10
  store i32 1, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #10
  store i32 0, ptr %32, align 4, !tbaa !5
  br label %514

514:                                              ; preds = %557, %509
  %515 = load i32, ptr %32, align 4, !tbaa !5
  %516 = load i32, ptr %28, align 4, !tbaa !5
  %517 = icmp ult i32 %515, %516
  br i1 %517, label %519, label %518

518:                                              ; preds = %514
  store i32 9, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #10
  br label %560

519:                                              ; preds = %514
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #10
  %520 = load ptr, ptr %24, align 8, !tbaa !9
  %521 = load i32, ptr %32, align 4, !tbaa !5
  %522 = zext i32 %521 to i64
  %523 = getelementptr inbounds i32, ptr %520, i64 %522
  %524 = load i32, ptr %523, align 4, !tbaa !5
  store i32 %524, ptr %33, align 4, !tbaa !5
  %525 = load i32, ptr %30, align 4, !tbaa !5
  %526 = load i32, ptr %33, align 4, !tbaa !5
  %527 = icmp ule i32 %525, %526
  br i1 %527, label %528, label %529

528:                                              ; preds = %519
  store ptr @.str.41, ptr %29, align 8, !tbaa !9
  br label %529

529:                                              ; preds = %528, %519
  %530 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %530, ptr %30, align 4, !tbaa !5
  br label %531

531:                                              ; preds = %553, %529
  %532 = load i32, ptr %32, align 4, !tbaa !5
  %533 = load i32, ptr %31, align 4, !tbaa !5
  %534 = add i32 %532, %533
  %535 = load i32, ptr %28, align 4, !tbaa !5
  %536 = icmp ult i32 %534, %535
  br i1 %536, label %537, label %551

537:                                              ; preds = %531
  %538 = load ptr, ptr %24, align 8, !tbaa !9
  %539 = load i32, ptr %32, align 4, !tbaa !5
  %540 = load i32, ptr %31, align 4, !tbaa !5
  %541 = add i32 %539, %540
  %542 = zext i32 %541 to i64
  %543 = getelementptr inbounds i32, ptr %538, i64 %542
  %544 = load i32, ptr %543, align 4, !tbaa !5
  %545 = load i32, ptr %33, align 4, !tbaa !5
  %546 = zext i32 %545 to i64
  %547 = load i32, ptr %31, align 4, !tbaa !5
  %548 = zext i32 %547 to i64
  %549 = call i32 @pgno_sub(i64 noundef %546, i64 noundef %548) #11
  %550 = icmp eq i32 %544, %549
  br label %551

551:                                              ; preds = %537, %531
  %552 = phi i1 [ false, %531 ], [ %550, %537 ]
  br i1 %552, label %553, label %556

553:                                              ; preds = %551
  %554 = load i32, ptr %31, align 4, !tbaa !5
  %555 = add i32 %554, 1
  store i32 %555, ptr %31, align 4, !tbaa !5
  br label %531, !llvm.loop !67

556:                                              ; preds = %551
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #10
  br label %557

557:                                              ; preds = %556
  %558 = load i32, ptr %32, align 4, !tbaa !5
  %559 = add i32 %558, 1
  store i32 %559, ptr %32, align 4, !tbaa !5
  br label %514, !llvm.loop !68

560:                                              ; preds = %518
  %561 = getelementptr inbounds %struct.iovec, ptr %26, i32 0, i32 0
  %562 = load ptr, ptr %561, align 8, !tbaa !63
  %563 = load i64, ptr %562, align 8, !tbaa !65
  %564 = load i32, ptr %28, align 4, !tbaa !5
  %565 = load i32, ptr %31, align 4, !tbaa !5
  %566 = load ptr, ptr %29, align 8, !tbaa !9
  %567 = call i32 (ptr, ...) @printf(ptr noundef @.str.42, i64 noundef %563, i32 noundef %564, i32 noundef %565, ptr noundef %566)
  %568 = load i32, ptr %17, align 4, !tbaa !5
  %569 = icmp sgt i32 %568, 2
  br i1 %569, label %570, label %624

570:                                              ; preds = %560
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #10
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %571

571:                                              ; preds = %619, %570
  %572 = load i32, ptr %34, align 4, !tbaa !5
  %573 = load i32, ptr %28, align 4, !tbaa !5
  %574 = icmp ult i32 %572, %573
  br i1 %574, label %576, label %575

575:                                              ; preds = %571
  store i32 14, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #10
  br label %623

576:                                              ; preds = %571
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #10
  %577 = load ptr, ptr %24, align 8, !tbaa !9
  %578 = load i32, ptr %34, align 4, !tbaa !5
  %579 = zext i32 %578 to i64
  %580 = getelementptr inbounds i32, ptr %577, i64 %579
  %581 = load i32, ptr %580, align 4, !tbaa !5
  store i32 %581, ptr %35, align 4, !tbaa !5
  store i32 1, ptr %31, align 4, !tbaa !5
  br label %582

582:                                              ; preds = %605, %576
  %583 = load i32, ptr %34, align 4, !tbaa !5
  %584 = load i32, ptr %31, align 4, !tbaa !5
  %585 = add i32 %583, %584
  %586 = load i32, ptr %28, align 4, !tbaa !5
  %587 = icmp ult i32 %585, %586
  br i1 %587, label %588, label %602

588:                                              ; preds = %582
  %589 = load ptr, ptr %24, align 8, !tbaa !9
  %590 = load i32, ptr %34, align 4, !tbaa !5
  %591 = load i32, ptr %31, align 4, !tbaa !5
  %592 = add i32 %590, %591
  %593 = zext i32 %592 to i64
  %594 = getelementptr inbounds i32, ptr %589, i64 %593
  %595 = load i32, ptr %594, align 4, !tbaa !5
  %596 = load i32, ptr %35, align 4, !tbaa !5
  %597 = zext i32 %596 to i64
  %598 = load i32, ptr %31, align 4, !tbaa !5
  %599 = zext i32 %598 to i64
  %600 = call i32 @pgno_sub(i64 noundef %597, i64 noundef %599) #11
  %601 = icmp eq i32 %595, %600
  br label %602

602:                                              ; preds = %588, %582
  %603 = phi i1 [ false, %582 ], [ %601, %588 ]
  br i1 %603, label %604, label %608

604:                                              ; preds = %602
  br label %605

605:                                              ; preds = %604
  %606 = load i32, ptr %31, align 4, !tbaa !5
  %607 = add i32 %606, 1
  store i32 %607, ptr %31, align 4, !tbaa !5
  br label %582, !llvm.loop !69

608:                                              ; preds = %602
  %609 = load i32, ptr %31, align 4, !tbaa !5
  %610 = icmp ugt i32 %609, 1
  br i1 %610, label %611, label %615

611:                                              ; preds = %608
  %612 = load i32, ptr %35, align 4, !tbaa !5
  %613 = load i32, ptr %31, align 4, !tbaa !5
  %614 = call i32 (ptr, ...) @printf(ptr noundef @.str.43, i32 noundef %612, i32 noundef %613)
  br label %618

615:                                              ; preds = %608
  %616 = load i32, ptr %35, align 4, !tbaa !5
  %617 = call i32 (ptr, ...) @printf(ptr noundef @.str.44, i32 noundef %616)
  br label %618

618:                                              ; preds = %615, %611
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #10
  br label %619

619:                                              ; preds = %618
  %620 = load i32, ptr %31, align 4, !tbaa !5
  %621 = load i32, ptr %34, align 4, !tbaa !5
  %622 = add i32 %621, %620
  store i32 %622, ptr %34, align 4, !tbaa !5
  br label %571, !llvm.loop !70

623:                                              ; preds = %575
  br label %624

624:                                              ; preds = %623, %560
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  br label %625

625:                                              ; preds = %624, %506
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #10
  br label %476, !llvm.loop !71

626:                                              ; preds = %483, %476
  %627 = load ptr, ptr %21, align 8, !tbaa !9
  call void @mdbx_cursor_close(ptr noundef %627)
  store ptr null, ptr %21, align 8, !tbaa !9
  %628 = load i32, ptr %7, align 4, !tbaa !5
  switch i32 %628, label %637 [
    i32 0, label %629
    i32 -30798, label %629
    i32 4, label %630
  ]

629:                                              ; preds = %626, %626
  br label %639

630:                                              ; preds = %626
  %631 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %632 = trunc i8 %631 to i1
  br i1 %632, label %636, label %633

633:                                              ; preds = %630
  %634 = load ptr, ptr @stderr, align 8, !tbaa !9
  %635 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %634, ptr noundef @.str.45) #10
  br label %636

636:                                              ; preds = %633, %630
  store i32 6, ptr %19, align 4
  br label %754

637:                                              ; preds = %626
  %638 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.46, i32 noundef %638)
  store i32 6, ptr %19, align 4
  br label %754

639:                                              ; preds = %629
  %640 = load i8, ptr %15, align 1, !tbaa !11, !range !30, !noundef !31
  %641 = trunc i8 %640 to i1
  br i1 %641, label %642, label %750

642:                                              ; preds = %639
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #10
  %643 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 1
  %644 = load i64, ptr %643, align 8, !tbaa !57
  %645 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %646 = load i32, ptr %645, align 8, !tbaa !52
  %647 = zext i32 %646 to i64
  %648 = udiv i64 %644, %647
  store i64 %648, ptr %36, align 8, !tbaa !65
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #10
  %649 = load i64, ptr %36, align 8, !tbaa !65
  %650 = uitofp i64 %649 to double
  %651 = fdiv double %650, 1.000000e+02
  store double %651, ptr %37, align 8, !tbaa !72
  %652 = call i32 (ptr, ...) @printf(ptr noundef @.str.47)
  %653 = load i64, ptr %36, align 8, !tbaa !65
  %654 = call i32 (ptr, ...) @printf(ptr noundef @.str.48, i64 noundef %653)
  %655 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 0
  %656 = getelementptr inbounds %struct.anon, ptr %655, i32 0, i32 2
  %657 = load i64, ptr %656, align 8, !tbaa !58
  %658 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %659 = load i32, ptr %658, align 8, !tbaa !52
  %660 = zext i32 %659 to i64
  %661 = udiv i64 %657, %660
  store i64 %661, ptr %36, align 8, !tbaa !65
  %662 = load i64, ptr %36, align 8, !tbaa !65
  %663 = load i64, ptr %36, align 8, !tbaa !65
  %664 = uitofp i64 %663 to double
  %665 = load double, ptr %37, align 8, !tbaa !72
  %666 = fdiv double %664, %665
  %667 = call i32 (ptr, ...) @printf(ptr noundef @.str.49, i64 noundef %662, double noundef %666)
  %668 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 2
  %669 = load i64, ptr %668, align 8, !tbaa !66
  %670 = add i64 %669, 1
  store i64 %670, ptr %36, align 8, !tbaa !65
  %671 = load i64, ptr %36, align 8, !tbaa !65
  %672 = load i64, ptr %36, align 8, !tbaa !65
  %673 = uitofp i64 %672 to double
  %674 = load double, ptr %37, align 8, !tbaa !72
  %675 = fdiv double %673, %674
  %676 = call i32 (ptr, ...) @printf(ptr noundef @.str.50, i64 noundef %671, double noundef %675)
  %677 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 1
  %678 = load i64, ptr %677, align 8, !tbaa !57
  %679 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %680 = load i32, ptr %679, align 8, !tbaa !52
  %681 = zext i32 %680 to i64
  %682 = udiv i64 %678, %681
  %683 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 2
  %684 = load i64, ptr %683, align 8, !tbaa !66
  %685 = add i64 %684, 1
  %686 = sub i64 %682, %685
  store i64 %686, ptr %36, align 8, !tbaa !65
  %687 = load i64, ptr %36, align 8, !tbaa !65
  %688 = load i64, ptr %36, align 8, !tbaa !65
  %689 = uitofp i64 %688 to double
  %690 = load double, ptr %37, align 8, !tbaa !72
  %691 = fdiv double %689, %690
  %692 = call i32 (ptr, ...) @printf(ptr noundef @.str.51, i64 noundef %687, double noundef %691)
  %693 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 2
  %694 = load i64, ptr %693, align 8, !tbaa !66
  %695 = add i64 %694, 1
  %696 = load i32, ptr %23, align 4, !tbaa !5
  %697 = zext i32 %696 to i64
  %698 = sub i64 %695, %697
  store i64 %698, ptr %36, align 8, !tbaa !65
  %699 = load i64, ptr %36, align 8, !tbaa !65
  %700 = load i64, ptr %36, align 8, !tbaa !65
  %701 = uitofp i64 %700 to double
  %702 = load double, ptr %37, align 8, !tbaa !72
  %703 = fdiv double %701, %702
  %704 = call i32 (ptr, ...) @printf(ptr noundef @.str.52, i64 noundef %699, double noundef %703)
  %705 = load i32, ptr %23, align 4, !tbaa !5
  %706 = zext i32 %705 to i64
  store i64 %706, ptr %36, align 8, !tbaa !65
  %707 = load i64, ptr %36, align 8, !tbaa !65
  %708 = load i64, ptr %36, align 8, !tbaa !65
  %709 = uitofp i64 %708 to double
  %710 = load double, ptr %37, align 8, !tbaa !72
  %711 = fdiv double %709, %710
  %712 = call i32 (ptr, ...) @printf(ptr noundef @.str.53, i64 noundef %707, double noundef %711)
  %713 = load i32, ptr %23, align 4, !tbaa !5
  %714 = load i32, ptr %25, align 4, !tbaa !5
  %715 = sub i32 %713, %714
  %716 = zext i32 %715 to i64
  store i64 %716, ptr %36, align 8, !tbaa !65
  %717 = load i64, ptr %36, align 8, !tbaa !65
  %718 = load i64, ptr %36, align 8, !tbaa !65
  %719 = uitofp i64 %718 to double
  %720 = load double, ptr %37, align 8, !tbaa !72
  %721 = fdiv double %719, %720
  %722 = call i32 (ptr, ...) @printf(ptr noundef @.str.54, i64 noundef %717, double noundef %721)
  %723 = load i32, ptr %25, align 4, !tbaa !5
  %724 = zext i32 %723 to i64
  store i64 %724, ptr %36, align 8, !tbaa !65
  %725 = load i64, ptr %36, align 8, !tbaa !65
  %726 = load i64, ptr %36, align 8, !tbaa !65
  %727 = uitofp i64 %726 to double
  %728 = load double, ptr %37, align 8, !tbaa !72
  %729 = fdiv double %727, %728
  %730 = call i32 (ptr, ...) @printf(ptr noundef @.str.55, i64 noundef %725, double noundef %729)
  %731 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 1
  %732 = load i64, ptr %731, align 8, !tbaa !57
  %733 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 10
  %734 = load i32, ptr %733, align 8, !tbaa !52
  %735 = zext i32 %734 to i64
  %736 = udiv i64 %732, %735
  %737 = getelementptr inbounds %struct.MDBX_envinfo, ptr %11, i32 0, i32 2
  %738 = load i64, ptr %737, align 8, !tbaa !66
  %739 = add i64 %738, 1
  %740 = sub i64 %736, %739
  %741 = load i32, ptr %25, align 4, !tbaa !5
  %742 = zext i32 %741 to i64
  %743 = add i64 %740, %742
  store i64 %743, ptr %36, align 8, !tbaa !65
  %744 = load i64, ptr %36, align 8, !tbaa !65
  %745 = load i64, ptr %36, align 8, !tbaa !65
  %746 = uitofp i64 %745 to double
  %747 = load double, ptr %37, align 8, !tbaa !72
  %748 = fdiv double %746, %747
  %749 = call i32 (ptr, ...) @printf(ptr noundef @.str.56, i64 noundef %744, double noundef %748)
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #10
  br label %753

750:                                              ; preds = %639
  %751 = load i32, ptr %23, align 4, !tbaa !5
  %752 = call i32 (ptr, ...) @printf(ptr noundef @.str.57, i32 noundef %751)
  br label %753

753:                                              ; preds = %750, %642
  store i32 0, ptr %19, align 4
  br label %754

754:                                              ; preds = %753, %637, %636
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %755

755:                                              ; preds = %754, %473
  call void @llvm.lifetime.end.p0(i64 48, ptr %22) #10
  br label %756

756:                                              ; preds = %755, %459
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  %757 = load i32, ptr %19, align 4
  switch i32 %757, label %937 [
    i32 0, label %758
    i32 6, label %927
  ]

758:                                              ; preds = %756
  br label %759

759:                                              ; preds = %758, %443
  %760 = load ptr, ptr %9, align 8, !tbaa !9
  %761 = load ptr, ptr %13, align 8, !tbaa !9
  %762 = call i32 @mdbx_dbi_open(ptr noundef %760, ptr noundef %761, i32 noundef 1073741824, ptr noundef %10)
  store i32 %762, ptr %7, align 4, !tbaa !5
  %763 = load i32, ptr %7, align 4, !tbaa !5
  %764 = icmp ne i32 %763, 0
  %765 = xor i1 %764, true
  %766 = xor i1 %765, true
  %767 = zext i1 %766 to i32
  %768 = sext i32 %767 to i64
  %769 = call i64 @llvm.expect.i64(i64 %768, i64 0)
  %770 = icmp ne i64 %769, 0
  br i1 %770, label %771, label %773

771:                                              ; preds = %759
  %772 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.58, i32 noundef %772)
  br label %927

773:                                              ; preds = %759
  %774 = load ptr, ptr %9, align 8, !tbaa !9
  %775 = load i32, ptr %10, align 4, !tbaa !5
  %776 = call i32 @mdbx_dbi_stat(ptr noundef %774, i32 noundef %775, ptr noundef %38, i64 noundef 48)
  store i32 %776, ptr %7, align 4, !tbaa !5
  %777 = load i32, ptr %7, align 4, !tbaa !5
  %778 = icmp ne i32 %777, 0
  %779 = xor i1 %778, true
  %780 = xor i1 %779, true
  %781 = zext i1 %780 to i32
  %782 = sext i32 %781 to i64
  %783 = call i64 @llvm.expect.i64(i64 %782, i64 0)
  %784 = icmp ne i64 %783, 0
  br i1 %784, label %785, label %787

785:                                              ; preds = %773
  %786 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.39, i32 noundef %786)
  br label %927

787:                                              ; preds = %773
  %788 = load ptr, ptr %13, align 8, !tbaa !9
  %789 = icmp ne ptr %788, null
  br i1 %789, label %790, label %792

790:                                              ; preds = %787
  %791 = load ptr, ptr %13, align 8, !tbaa !9
  br label %793

792:                                              ; preds = %787
  br label %793

793:                                              ; preds = %792, %790
  %794 = phi ptr [ %791, %790 ], [ @.str.60, %792 ]
  %795 = call i32 (ptr, ...) @printf(ptr noundef @.str.59, ptr noundef %794)
  call void @print_stat(ptr noundef %38)
  %796 = load i8, ptr %14, align 1, !tbaa !11, !range !30, !noundef !31
  %797 = trunc i8 %796 to i1
  br i1 %797, label %798, label %901

798:                                              ; preds = %793
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #10
  %799 = load ptr, ptr %9, align 8, !tbaa !9
  %800 = load i32, ptr %10, align 4, !tbaa !5
  %801 = call i32 @mdbx_cursor_open(ptr noundef %799, i32 noundef %800, ptr noundef %39)
  store i32 %801, ptr %7, align 4, !tbaa !5
  %802 = load i32, ptr %7, align 4, !tbaa !5
  %803 = icmp ne i32 %802, 0
  %804 = xor i1 %803, true
  %805 = xor i1 %804, true
  %806 = zext i1 %805 to i32
  %807 = sext i32 %806 to i64
  %808 = call i64 @llvm.expect.i64(i64 %807, i64 0)
  %809 = icmp ne i64 %808, 0
  br i1 %809, label %810, label %812

810:                                              ; preds = %798
  %811 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.38, i32 noundef %811)
  store i32 6, ptr %19, align 4
  br label %898

812:                                              ; preds = %798
  call void @llvm.lifetime.start.p0(i64 16, ptr %40) #10
  br label %813

813:                                              ; preds = %894, %892, %812
  %814 = load ptr, ptr %39, align 8, !tbaa !9
  %815 = call i32 @mdbx_cursor_get(ptr noundef %814, ptr noundef %40, ptr noundef null, i32 noundef 11)
  store i32 %815, ptr %7, align 4, !tbaa !5
  %816 = icmp eq i32 0, %815
  br i1 %816, label %817, label %895

817:                                              ; preds = %813
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #10
  %818 = getelementptr inbounds %struct.iovec, ptr %40, i32 0, i32 0
  %819 = load ptr, ptr %818, align 8, !tbaa !63
  %820 = getelementptr inbounds %struct.iovec, ptr %40, i32 0, i32 1
  %821 = load i64, ptr %820, align 8, !tbaa !74
  %822 = call ptr @memchr(ptr noundef %819, i32 noundef 0, i64 noundef %821) #12
  %823 = icmp ne ptr %822, null
  br i1 %823, label %824, label %825

824:                                              ; preds = %817
  store i32 21, ptr %19, align 4
  br label %892, !llvm.loop !75

825:                                              ; preds = %817
  %826 = getelementptr inbounds %struct.iovec, ptr %40, i32 0, i32 1
  %827 = load i64, ptr %826, align 8, !tbaa !74
  %828 = add i64 %827, 1
  %829 = call noalias ptr @malloc(i64 noundef %828) #13
  store ptr %829, ptr %13, align 8, !tbaa !9
  %830 = load ptr, ptr %13, align 8, !tbaa !9
  %831 = getelementptr inbounds %struct.iovec, ptr %40, i32 0, i32 0
  %832 = load ptr, ptr %831, align 8, !tbaa !63
  %833 = getelementptr inbounds %struct.iovec, ptr %40, i32 0, i32 1
  %834 = load i64, ptr %833, align 8, !tbaa !74
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %830, ptr align 1 %832, i64 %834, i1 false)
  %835 = load ptr, ptr %13, align 8, !tbaa !9
  %836 = getelementptr inbounds %struct.iovec, ptr %40, i32 0, i32 1
  %837 = load i64, ptr %836, align 8, !tbaa !74
  %838 = getelementptr inbounds i8, ptr %835, i64 %837
  store i8 0, ptr %838, align 1, !tbaa !76
  %839 = load ptr, ptr %9, align 8, !tbaa !9
  %840 = load ptr, ptr %13, align 8, !tbaa !9
  %841 = call i32 @mdbx_dbi_open(ptr noundef %839, ptr noundef %840, i32 noundef 1073741824, ptr noundef %41)
  store i32 %841, ptr %7, align 4, !tbaa !5
  %842 = load i32, ptr %7, align 4, !tbaa !5
  %843 = icmp eq i32 %842, 0
  br i1 %843, label %844, label %847

844:                                              ; preds = %825
  %845 = load ptr, ptr %13, align 8, !tbaa !9
  %846 = call i32 (ptr, ...) @printf(ptr noundef @.str.59, ptr noundef %845)
  br label %847

847:                                              ; preds = %844, %825
  %848 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %848) #10
  %849 = load i32, ptr %7, align 4, !tbaa !5
  %850 = icmp ne i32 %849, 0
  %851 = xor i1 %850, true
  %852 = xor i1 %851, true
  %853 = zext i1 %852 to i32
  %854 = sext i32 %853 to i64
  %855 = call i64 @llvm.expect.i64(i64 %854, i64 0)
  %856 = icmp ne i64 %855, 0
  br i1 %856, label %857, label %863

857:                                              ; preds = %847
  %858 = load i32, ptr %7, align 4, !tbaa !5
  %859 = icmp eq i32 %858, -30784
  br i1 %859, label %860, label %861

860:                                              ; preds = %857
  store i32 21, ptr %19, align 4
  br label %892, !llvm.loop !75

861:                                              ; preds = %857
  %862 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.58, i32 noundef %862)
  store i32 6, ptr %19, align 4
  br label %892

863:                                              ; preds = %847
  %864 = load ptr, ptr %9, align 8, !tbaa !9
  %865 = load i32, ptr %41, align 4, !tbaa !5
  %866 = call i32 @mdbx_dbi_stat(ptr noundef %864, i32 noundef %865, ptr noundef %38, i64 noundef 48)
  store i32 %866, ptr %7, align 4, !tbaa !5
  %867 = load i32, ptr %7, align 4, !tbaa !5
  %868 = icmp ne i32 %867, 0
  %869 = xor i1 %868, true
  %870 = xor i1 %869, true
  %871 = zext i1 %870 to i32
  %872 = sext i32 %871 to i64
  %873 = call i64 @llvm.expect.i64(i64 %872, i64 0)
  %874 = icmp ne i64 %873, 0
  br i1 %874, label %875, label %877

875:                                              ; preds = %863
  %876 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.39, i32 noundef %876)
  store i32 6, ptr %19, align 4
  br label %892

877:                                              ; preds = %863
  call void @print_stat(ptr noundef %38)
  %878 = load ptr, ptr %8, align 8, !tbaa !9
  %879 = load i32, ptr %41, align 4, !tbaa !5
  %880 = call i32 @mdbx_dbi_close(ptr noundef %878, i32 noundef %879)
  store i32 %880, ptr %7, align 4, !tbaa !5
  %881 = load i32, ptr %7, align 4, !tbaa !5
  %882 = icmp ne i32 %881, 0
  %883 = xor i1 %882, true
  %884 = xor i1 %883, true
  %885 = zext i1 %884 to i32
  %886 = sext i32 %885 to i64
  %887 = call i64 @llvm.expect.i64(i64 %886, i64 0)
  %888 = icmp ne i64 %887, 0
  br i1 %888, label %889, label %891

889:                                              ; preds = %877
  %890 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.61, i32 noundef %890)
  store i32 6, ptr %19, align 4
  br label %892

891:                                              ; preds = %877
  store i32 0, ptr %19, align 4
  br label %892

892:                                              ; preds = %891, %889, %875, %861, %860, %824
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #10
  %893 = load i32, ptr %19, align 4
  switch i32 %893, label %897 [
    i32 0, label %894
    i32 21, label %813
  ]

894:                                              ; preds = %892
  br label %813, !llvm.loop !75

895:                                              ; preds = %813
  %896 = load ptr, ptr %39, align 8, !tbaa !9
  call void @mdbx_cursor_close(ptr noundef %896)
  store ptr null, ptr %39, align 8, !tbaa !9
  store i32 0, ptr %19, align 4
  br label %897

897:                                              ; preds = %895, %892
  call void @llvm.lifetime.end.p0(i64 16, ptr %40) #10
  br label %898

898:                                              ; preds = %897, %810
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #10
  %899 = load i32, ptr %19, align 4
  switch i32 %899, label %937 [
    i32 0, label %900
    i32 6, label %927
  ]

900:                                              ; preds = %898
  br label %901

901:                                              ; preds = %900, %793
  %902 = load i32, ptr %7, align 4, !tbaa !5
  switch i32 %902, label %911 [
    i32 0, label %903
    i32 -30798, label %903
    i32 4, label %904
  ]

903:                                              ; preds = %901, %901
  br label %923

904:                                              ; preds = %901
  %905 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %906 = trunc i8 %905 to i1
  br i1 %906, label %910, label %907

907:                                              ; preds = %904
  %908 = load ptr, ptr @stderr, align 8, !tbaa !9
  %909 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %908, ptr noundef @.str.45) #10
  br label %910

910:                                              ; preds = %907, %904
  br label %923

911:                                              ; preds = %901
  %912 = load i32, ptr %7, align 4, !tbaa !5
  %913 = icmp ne i32 %912, 0
  %914 = xor i1 %913, true
  %915 = xor i1 %914, true
  %916 = zext i1 %915 to i32
  %917 = sext i32 %916 to i64
  %918 = call i64 @llvm.expect.i64(i64 %917, i64 0)
  %919 = icmp ne i64 %918, 0
  br i1 %919, label %920, label %922

920:                                              ; preds = %911
  %921 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.46, i32 noundef %921)
  br label %922

922:                                              ; preds = %920, %911
  br label %923

923:                                              ; preds = %922, %910, %903
  %924 = load ptr, ptr %8, align 8, !tbaa !9
  %925 = load i32, ptr %10, align 4, !tbaa !5
  %926 = call i32 @mdbx_dbi_close(ptr noundef %924, i32 noundef %925)
  br label %927

927:                                              ; preds = %923, %898, %785, %771, %756, %441, %428, %389, %214, %191
  %928 = load ptr, ptr %9, align 8, !tbaa !9
  %929 = call i32 @mdbx_txn_abort(ptr noundef %928)
  br label %930

930:                                              ; preds = %927, %178, %163
  %931 = load ptr, ptr %8, align 8, !tbaa !9
  %932 = call i32 @mdbx_env_close(ptr noundef %931)
  %933 = load i32, ptr %7, align 4, !tbaa !5
  %934 = icmp ne i32 %933, 0
  %935 = zext i1 %934 to i64
  %936 = select i1 %934, i32 1, i32 0
  store i32 %936, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %937

937:                                              ; preds = %930, %898, %756, %428, %144, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 352, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #10
  %938 = load i32, ptr %3, align 4
  ret i32 %938
}

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

; Function Attrs: nounwind uwtable
declare hidden void @usage(ptr noundef) #0

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @signal_handler(i32 noundef) #0

declare i32 @fflush(ptr noundef) #3

declare i32 @mdbx_setup_debug(i32 noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @logger(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

declare i32 @mdbx_env_create(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden void @error(ptr noundef, i32 noundef) #0

declare i32 @mdbx_env_set_maxdbs(ptr noundef, i32 noundef) #3

declare i32 @mdbx_env_open(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @mdbx_txn_begin(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare i32 @mdbx_env_info_ex(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare i32 @mdbx_reader_list(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @reader_list_func(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #0

declare i32 @mdbx_reader_check(ptr noundef, ptr noundef) #3

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

declare i32 @mdbx_cursor_open(ptr noundef, i32 noundef, ptr noundef) #3

declare i32 @mdbx_dbi_stat(ptr noundef, i32 noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @print_stat(ptr noundef) #0

declare i32 @mdbx_cursor_get(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint nounwind willreturn memory(none) uwtable
declare hidden i32 @pgno_sub(i64 noundef, i64 noundef) #6

declare void @mdbx_cursor_close(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

declare i32 @mdbx_dbi_open(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare ptr @memchr(ptr noundef, i32 noundef, i64 noundef) #7

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #8

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

declare i32 @mdbx_dbi_close(ptr noundef, i32 noundef) #3

declare i32 @mdbx_txn_abort(ptr noundef) #3

declare i32 @mdbx_env_close(ptr noundef) #3

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"MDBX_version_info", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !10, i64 8, !16, i64 16, !10, i64 48}
!15 = !{!"short", !7, i64 0}
!16 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!17 = !{!14, !15, i64 2}
!18 = !{!14, !15, i64 4}
!19 = !{!14, !15, i64 6}
!20 = !{!14, !10, i64 40}
!21 = !{!14, !10, i64 16}
!22 = !{!14, !10, i64 32}
!23 = !{!14, !10, i64 24}
!24 = !{!25, !10, i64 0}
!25 = !{!"MDBX_build_info", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!26 = !{!25, !10, i64 8}
!27 = !{!25, !10, i64 24}
!28 = !{!25, !10, i64 32}
!29 = !{!25, !10, i64 16}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!35, !37, i64 240}
!35 = !{!"MDBX_envinfo", !36, i64 0, !37, i64 40, !37, i64 48, !37, i64 56, !37, i64 64, !37, i64 72, !7, i64 80, !7, i64 104, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !38, i64 144, !37, i64 208, !37, i64 216, !6, i64 224, !6, i64 228, !6, i64 232, !6, i64 236, !40, i64 240, !39, i64 336}
!36 = !{!"", !37, i64 0, !37, i64 8, !37, i64 16, !37, i64 24, !37, i64 32}
!37 = !{!"long", !7, i64 0}
!38 = !{!"", !39, i64 0, !7, i64 16}
!39 = !{!"", !37, i64 0, !37, i64 8}
!40 = !{!"", !37, i64 0, !37, i64 8, !37, i64 16, !37, i64 24, !37, i64 32, !37, i64 40, !37, i64 48, !37, i64 56, !37, i64 64, !37, i64 72, !37, i64 80, !37, i64 88}
!41 = !{!35, !37, i64 248}
!42 = !{!35, !37, i64 256}
!43 = !{!35, !37, i64 264}
!44 = !{!35, !37, i64 272}
!45 = !{!35, !37, i64 280}
!46 = !{!35, !37, i64 288}
!47 = !{!35, !37, i64 296}
!48 = !{!35, !37, i64 304}
!49 = !{!35, !37, i64 312}
!50 = !{!35, !37, i64 320}
!51 = !{!35, !37, i64 328}
!52 = !{!35, !6, i64 136}
!53 = !{!35, !37, i64 0}
!54 = !{!35, !37, i64 8}
!55 = !{!35, !37, i64 32}
!56 = !{!35, !37, i64 24}
!57 = !{!35, !37, i64 40}
!58 = !{!35, !37, i64 16}
!59 = !{!35, !37, i64 56}
!60 = !{!35, !37, i64 64}
!61 = !{!35, !6, i64 128}
!62 = !{!35, !6, i64 132}
!63 = !{!64, !10, i64 0}
!64 = !{!"iovec", !10, i64 0, !37, i64 8}
!65 = !{!37, !37, i64 0}
!66 = !{!35, !37, i64 48}
!67 = distinct !{!67, !33}
!68 = distinct !{!68, !33}
!69 = distinct !{!69, !33}
!70 = distinct !{!70, !33}
!71 = distinct !{!71, !33}
!72 = !{!73, !73, i64 0}
!73 = !{!"double", !7, i64 0}
!74 = !{!64, !37, i64 8}
!75 = distinct !{!75, !33}
!76 = !{!7, !7, 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.MDBX_version_info = type { i16, i16, i16, i16, ptr, %struct.anon.4, ptr }
%struct.anon.4 = type { ptr, ptr, ptr, ptr }
%struct.MDBX_build_info = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.MDBX_envinfo = type { %struct.anon, i64, i64, i64, i64, i64, [3 x i64], [3 x i64], i32, i32, i32, i32, %struct.anon.0, i64, i64, i32, i32, i32, i32, %struct.anon.2, %struct.anon.3 }
%struct.anon = type { i64, i64, i64, i64, i64 }
%struct.anon.0 = type { %struct.anon.1, [3 x %struct.anon.1] }
%struct.anon.1 = type { i64, i64 }
%struct.anon.2 = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.anon.3 = type { i64, i64 }
%struct.MDBX_stat = type { i32, i32, i64, i64, i64, i64, i64 }
%struct.iovec = type { ptr, i64 }

@quiet = external dso_local local_unnamed_addr global i8, align 1
@prog = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [136 x i8], align 1
@mdbx_version = external local_unnamed_addr constant %struct.MDBX_version_info, align 8
@mdbx_sourcery_MDBX_BUILD_SOURCERY = external local_unnamed_addr constant ptr, align 8
@mdbx_build = external local_unnamed_addr constant %struct.MDBX_build_info, align 8
@optarg = external local_unnamed_addr global ptr, align 8
@optind = external local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [14 x i8], align 1
@user_break = external hidden global i32, align 4
@.str.40 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [10 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.45 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.MDBX_envinfo, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %struct.MDBX_stat, align 8
  %10 = alloca %struct.iovec, align 8
  %11 = alloca %struct.iovec, align 8
  %12 = alloca %struct.MDBX_stat, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %struct.iovec, align 8
  %15 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #11
  call void @llvm.lifetime.start.p0(i64 352, ptr nonnull %6) #11
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  store ptr %16, ptr @prog, align 8, !tbaa !5
  %17 = icmp slt i32 %0, 2
  br i1 %17, label %18, label %.preheader

18:                                               ; preds = %2
  tail call void @usage(ptr noundef %16)
  br label %.preheader

.preheader:                                       ; preds = %18, %2
  br label %19

19:                                               ; preds = %.backedge, %.preheader
  %.0207 = phi i1 [ false, %.preheader ], [ %.0207.be, %.backedge ]
  %.0205 = phi i8 [ 0, %.preheader ], [ %.0205.be, %.backedge ]
  %.0203 = phi i32 [ 0, %.preheader ], [ %.0203.be, %.backedge ]
  %.0201 = phi i32 [ 0, %.preheader ], [ %.0201.be, %.backedge ]
  %.0189 = phi i8 [ 0, %.preheader ], [ %.0189.be, %.backedge ]
  %.0180 = phi ptr [ null, %.preheader ], [ %.0180.be, %.backedge ]
  %20 = tail call i32 @getopt(i32 noundef %0, ptr noundef nonnull %1, ptr noundef nonnull @.str) #11
  switch i32 %20, label %57 [
    i32 -1, label %59
    i32 86, label %21
    i32 113, label %41
    i32 112, label %42
    i32 97, label %43
    i32 101, label %46
    i32 102, label %47
    i32 110, label %.backedge
    i32 114, label %49
    i32 115, label %51
  ]

21:                                               ; preds = %19
  %22 = load i16, ptr @mdbx_version, align 8, !tbaa !9
  %23 = zext i16 %22 to i32
  %24 = load i16, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 2), align 2, !tbaa !13
  %25 = zext i16 %24 to i32
  %26 = load i16, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 4), align 4, !tbaa !14
  %27 = zext i16 %26 to i32
  %28 = load i16, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 6), align 2, !tbaa !15
  %29 = zext i16 %28 to i32
  %30 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 40), align 8, !tbaa !16
  %31 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 16), align 8, !tbaa !17
  %32 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 32), align 8, !tbaa !18
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 24), align 8, !tbaa !19
  %34 = load ptr, ptr @mdbx_sourcery_MDBX_BUILD_SOURCERY, align 8, !tbaa !5
  %35 = load ptr, ptr @mdbx_build, align 8, !tbaa !20
  %36 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_build, i64 8), align 8, !tbaa !22
  %37 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_build, i64 24), align 8, !tbaa !23
  %38 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_build, i64 32), align 8, !tbaa !24
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_build, i64 16), align 8, !tbaa !25
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %23, i32 noundef %25, i32 noundef %27, i32 noundef %29, ptr noundef %30, ptr noundef %31, ptr noundef %32, ptr noundef %33, ptr noundef %34, ptr noundef %35, ptr noundef %36, ptr noundef %37, ptr noundef %38, ptr noundef %39)
  br label %468

41:                                               ; preds = %19
  store i8 1, ptr @quiet, align 1, !tbaa !26
  br label %.backedge

42:                                               ; preds = %19
  br label %.backedge

43:                                               ; preds = %19
  %.not264 = icmp eq ptr %.0180, null
  br i1 %.not264, label %.backedge, label %44

.backedge:                                        ; preds = %43, %44, %19, %57, %55, %49, %47, %46, %42, %41
  %.0207.be = phi i1 [ %.0207, %57 ], [ %.0207, %55 ], [ %.0207, %49 ], [ %.0207, %47 ], [ true, %46 ], [ %.0207, %42 ], [ %.0207, %41 ], [ %.0207, %19 ], [ %.0207, %44 ], [ %.0207, %43 ]
  %.0205.be = phi i8 [ %.0205, %57 ], [ %.0205, %55 ], [ %.0205, %49 ], [ %.0205, %47 ], [ %.0205, %46 ], [ 1, %42 ], [ %.0205, %41 ], [ %.0205, %19 ], [ %.0205, %44 ], [ %.0205, %43 ]
  %.0203.be = phi i32 [ %.0203, %57 ], [ %.0203, %55 ], [ %.0203, %49 ], [ %48, %47 ], [ %.0203, %46 ], [ %.0203, %42 ], [ %.0203, %41 ], [ %.0203, %19 ], [ %.0203, %44 ], [ %.0203, %43 ]
  %.0201.be = phi i32 [ %.0201, %57 ], [ %.0201, %55 ], [ %50, %49 ], [ %.0201, %47 ], [ %.0201, %46 ], [ %.0201, %42 ], [ %.0201, %41 ], [ %.0201, %19 ], [ %.0201, %44 ], [ %.0201, %43 ]
  %.0189.be = phi i8 [ %.0189, %57 ], [ %.0189, %55 ], [ %.0189, %49 ], [ %.0189, %47 ], [ %.0189, %46 ], [ %.0189, %42 ], [ %.0189, %41 ], [ %.0189, %19 ], [ 1, %44 ], [ 1, %43 ]
  %.0180.be = phi ptr [ %.0180, %57 ], [ %56, %55 ], [ %.0180, %49 ], [ %.0180, %47 ], [ %.0180, %46 ], [ %.0180, %42 ], [ %.0180, %41 ], [ %.0180, %19 ], [ %.0180, %44 ], [ null, %43 ]
  br label %19, !llvm.loop !28

44:                                               ; preds = %43
  %45 = load ptr, ptr @prog, align 8, !tbaa !5
  tail call void @usage(ptr noundef %45)
  br label %.backedge

46:                                               ; preds = %19
  br label %.backedge

47:                                               ; preds = %19
  %48 = add i32 %.0203, 1
  br label %.backedge

49:                                               ; preds = %19
  %50 = add nsw i32 %.0201, 1
  br label %.backedge

51:                                               ; preds = %19
  %52 = trunc nuw i8 %.0189 to i1
  br i1 %52, label %53, label %55

53:                                               ; preds = %51
  %54 = load ptr, ptr @prog, align 8, !tbaa !5
  tail call void @usage(ptr noundef %54)
  br label %55

55:                                               ; preds = %53, %51
  %56 = load ptr, ptr @optarg, align 8, !tbaa !5
  br label %.backedge

57:                                               ; preds = %19
  %58 = load ptr, ptr @prog, align 8, !tbaa !5
  tail call void @usage(ptr noundef %58)
  br label %.backedge

59:                                               ; preds = %19
  %60 = load i32, ptr @optind, align 4, !tbaa !30
  %61 = add nsw i32 %0, -1
  %.not241 = icmp eq i32 %60, %61
  br i1 %.not241, label %64, label %62

62:                                               ; preds = %59
  %63 = load ptr, ptr @prog, align 8, !tbaa !5
  tail call void @usage(ptr noundef %63)
  br label %64

64:                                               ; preds = %62, %59
  %65 = tail call ptr @signal(i32 noundef 13, ptr noundef nonnull @signal_handler) #11
  %66 = tail call ptr @signal(i32 noundef 1, ptr noundef nonnull @signal_handler) #11
  %67 = tail call ptr @signal(i32 noundef 2, ptr noundef nonnull @signal_handler) #11
  %68 = tail call ptr @signal(i32 noundef 15, ptr noundef nonnull @signal_handler) #11
  %69 = load i32, ptr @optind, align 4, !tbaa !30
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds ptr, ptr %1, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = load i8, ptr @quiet, align 1, !tbaa !26, !range !32, !noundef !33
  %74 = trunc nuw i8 %73 to i1
  br i1 %74, label %82, label %75

75:                                               ; preds = %64
  %76 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 40), align 8, !tbaa !16
  %77 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 16), align 8, !tbaa !17
  %78 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 24), align 8, !tbaa !19
  %79 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %76, ptr noundef %77, ptr noundef %78, ptr noundef %72)
  %80 = tail call i32 @fflush(ptr noundef null)
  %81 = tail call i32 @mdbx_setup_debug(i32 noundef 3, i32 noundef -1, ptr noundef nonnull @logger) #11
  br label %82

82:                                               ; preds = %75, %64
  %83 = call i32 @mdbx_env_create(ptr noundef nonnull %3) #11
  %.not242 = icmp eq i32 %83, 0
  br i1 %.not242, label %85, label %84, !prof !34

84:                                               ; preds = %82
  call void @error(ptr noundef nonnull @.str.3, i32 noundef %83)
  br label %468

85:                                               ; preds = %82
  %86 = trunc nuw i8 %.0189 to i1
  %87 = icmp ne ptr %.0180, null
  %or.cond = select i1 %86, i1 true, i1 %87
  br i1 %or.cond, label %88, label %92

88:                                               ; preds = %85
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = call i32 @mdbx_env_set_maxdbs(ptr noundef %89, i32 noundef 2) #11
  %.not243 = icmp eq i32 %90, 0
  br i1 %.not243, label %92, label %91, !prof !34

91:                                               ; preds = %88
  call void @error(ptr noundef nonnull @.str.4, i32 noundef %90)
  br label %465

92:                                               ; preds = %88, %85
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = call i32 @mdbx_env_open(ptr noundef %93, ptr noundef %72, i32 noundef 131072, i32 noundef 0) #11
  %.not244 = icmp eq i32 %94, 0
  br i1 %.not244, label %96, label %95, !prof !34

95:                                               ; preds = %92
  call void @error(ptr noundef nonnull @.str.5, i32 noundef %94)
  br label %465

96:                                               ; preds = %92
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = call i32 @mdbx_txn_begin(ptr noundef %97, ptr noundef null, i32 noundef 131072, ptr noundef nonnull %4) #11
  %.not245 = icmp eq i32 %98, 0
  br i1 %.not245, label %100, label %99, !prof !34

99:                                               ; preds = %96
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %98)
  br label %460

100:                                              ; preds = %96
  %101 = icmp ne i32 %.0203, 0
  %or.cond3 = select i1 %.0207, i1 true, i1 %101
  br i1 %or.cond3, label %104, label %102

102:                                              ; preds = %100
  %103 = trunc nuw i8 %.0205 to i1
  br i1 %103, label %104, label %.thread389

104:                                              ; preds = %102, %100
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = call i32 @mdbx_env_info_ex(ptr noundef %105, ptr noundef %106, ptr noundef nonnull %6, i64 noundef 352) #11
  %.not246 = icmp eq i32 %107, 0
  br i1 %.not246, label %109, label %108, !prof !34

108:                                              ; preds = %104
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %107)
  br label %460

.thread389:                                       ; preds = %102
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(352) %6, i8 0, i64 352, i1 false)
  br label %148

109:                                              ; preds = %104
  %.pre = trunc nuw i8 %.0205 to i1
  br i1 %.pre, label %110, label %148

110:                                              ; preds = %109
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %112 = getelementptr inbounds i8, ptr %6, i64 240
  %113 = load i64, ptr %112, align 8, !tbaa !35
  %114 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i64 noundef %113)
  %115 = getelementptr inbounds i8, ptr %6, i64 248
  %116 = load i64, ptr %115, align 8, !tbaa !42
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i64 noundef %116)
  %118 = getelementptr inbounds i8, ptr %6, i64 256
  %119 = load i64, ptr %118, align 8, !tbaa !43
  %120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i64 noundef %119)
  %121 = getelementptr inbounds i8, ptr %6, i64 264
  %122 = load i64, ptr %121, align 8, !tbaa !44
  %123 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i64 noundef %122)
  %124 = getelementptr inbounds i8, ptr %6, i64 272
  %125 = load i64, ptr %124, align 8, !tbaa !45
  %126 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i64 noundef %125)
  %127 = getelementptr inbounds i8, ptr %6, i64 280
  %128 = load i64, ptr %127, align 8, !tbaa !46
  %129 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i64 noundef %128)
  %130 = getelementptr inbounds i8, ptr %6, i64 288
  %131 = load i64, ptr %130, align 8, !tbaa !47
  %132 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i64 noundef %131)
  %133 = getelementptr inbounds i8, ptr %6, i64 296
  %134 = load i64, ptr %133, align 8, !tbaa !48
  %135 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i64 noundef %134)
  %136 = getelementptr inbounds i8, ptr %6, i64 304
  %137 = load i64, ptr %136, align 8, !tbaa !49
  %138 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, i64 noundef %137)
  %139 = getelementptr inbounds i8, ptr %6, i64 312
  %140 = load i64, ptr %139, align 8, !tbaa !50
  %141 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, i64 noundef %140)
  %142 = getelementptr inbounds i8, ptr %6, i64 320
  %143 = load i64, ptr %142, align 8, !tbaa !51
  %144 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i64 noundef %143)
  %145 = getelementptr inbounds i8, ptr %6, i64 328
  %146 = load i64, ptr %145, align 8, !tbaa !52
  %147 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %146)
  br label %148

148:                                              ; preds = %.thread389, %110, %109
  br i1 %.0207, label %149, label %196

149:                                              ; preds = %148
  %150 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  %151 = getelementptr inbounds i8, ptr %6, i64 136
  %152 = load i32, ptr %151, align 8, !tbaa !53
  %153 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, i32 noundef %152)
  %154 = load i64, ptr %6, align 8, !tbaa !54
  %155 = getelementptr inbounds i8, ptr %6, i64 8
  %156 = load i64, ptr %155, align 8, !tbaa !55
  %.not247 = icmp eq i64 %154, %156
  br i1 %.not247, label %175, label %157

157:                                              ; preds = %149
  %158 = getelementptr inbounds i8, ptr %6, i64 32
  %159 = load i64, ptr %158, align 8, !tbaa !56
  %160 = getelementptr inbounds i8, ptr %6, i64 24
  %161 = load i64, ptr %160, align 8, !tbaa !57
  %162 = load i32, ptr %151, align 8, !tbaa !53
  %163 = zext i32 %162 to i64
  %164 = udiv i64 %154, %163
  %165 = udiv i64 %156, %163
  %166 = udiv i64 %159, %163
  %167 = udiv i64 %161, %163
  %168 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i64 noundef %154, i64 noundef %156, i64 noundef %159, i64 noundef %161, i64 noundef %164, i64 noundef %165, i64 noundef %166, i64 noundef %167)
  %169 = getelementptr inbounds i8, ptr %6, i64 40
  %170 = load i64, ptr %169, align 8, !tbaa !58
  %171 = load i32, ptr %151, align 8, !tbaa !53
  %172 = zext i32 %171 to i64
  %173 = udiv i64 %170, %172
  %174 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24, i64 noundef %170, i64 noundef %173)
  br label %175

175:                                              ; preds = %149, %157
  %.str.26.sink = phi ptr [ @.str.25, %157 ], [ @.str.26, %149 ]
  %176 = getelementptr inbounds i8, ptr %6, i64 16
  %177 = load i64, ptr %176, align 8, !tbaa !59
  %178 = load i32, ptr %151, align 8, !tbaa !53
  %179 = zext i32 %178 to i64
  %180 = udiv i64 %177, %179
  %181 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.26.sink, i64 noundef %177, i64 noundef %180)
  %182 = getelementptr inbounds i8, ptr %6, i64 56
  %183 = load i64, ptr %182, align 8, !tbaa !60
  %184 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, i64 noundef %183)
  %185 = getelementptr inbounds i8, ptr %6, i64 64
  %186 = load i64, ptr %185, align 8, !tbaa !61
  %187 = load i64, ptr %182, align 8, !tbaa !60
  %188 = sub i64 %186, %187
  %189 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, i64 noundef %186, i64 noundef %188)
  %190 = getelementptr inbounds i8, ptr %6, i64 128
  %191 = load i32, ptr %190, align 8, !tbaa !62
  %192 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, i32 noundef %191)
  %193 = getelementptr inbounds i8, ptr %6, i64 132
  %194 = load i32, ptr %193, align 4, !tbaa !63
  %195 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, i32 noundef %194)
  br label %196

196:                                              ; preds = %175, %148
  %.not248 = icmp eq i32 %.0201, 0
  br i1 %.not248, label %224, label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %3, align 8, !tbaa !5
  %199 = call i32 @mdbx_reader_list(ptr noundef %198, ptr noundef nonnull @reader_list_func, ptr noundef null) #11
  %200 = add i32 %199, -1
  %or.cond5 = icmp ult i32 %200, -2
  br i1 %or.cond5, label %201, label %202

201:                                              ; preds = %197
  call void @error(ptr noundef nonnull @.str.31, i32 noundef %199)
  br label %460

202:                                              ; preds = %197
  %203 = icmp eq i32 %199, -1
  br i1 %203, label %204, label %206

204:                                              ; preds = %202
  %205 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  br label %222

206:                                              ; preds = %202
  %207 = icmp sgt i32 %.0201, 1
  br i1 %207, label %208, label %222

208:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #11
  %209 = load ptr, ptr %3, align 8, !tbaa !5
  %210 = call i32 @mdbx_reader_check(ptr noundef %209, ptr noundef nonnull %7) #11
  %211 = add i32 %210, -1
  %or.cond9 = icmp ult i32 %211, -2
  br i1 %or.cond9, label %221, label %212

212:                                              ; preds = %208
  %213 = icmp eq i32 %210, -1
  br i1 %213, label %214, label %.thread.sink.split

214:                                              ; preds = %212
  %215 = load i32, ptr %7, align 4, !tbaa !30
  %216 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34, i32 noundef %215)
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  %218 = call i32 @mdbx_reader_list(ptr noundef %217, ptr noundef nonnull @reader_list_func, ptr noundef null) #11
  %219 = icmp eq i32 %218, -1
  br i1 %219, label %.thread.sink.split, label %.thread

.thread.sink.split:                               ; preds = %212, %214
  %.str.35.sink = phi ptr [ @.str.35, %214 ], [ @.str.36, %212 ]
  %.1.ph.ph = phi i32 [ -1, %214 ], [ 0, %212 ]
  %220 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.35.sink)
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %214
  %.1.ph = phi i32 [ %218, %214 ], [ %.1.ph.ph, %.thread.sink.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #11
  br label %222

221:                                              ; preds = %208
  call void @error(ptr noundef nonnull @.str.33, i32 noundef %210)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #11
  br label %460

222:                                              ; preds = %.thread, %206, %204
  %.2 = phi i32 [ -1, %204 ], [ 0, %206 ], [ %.1.ph, %.thread ]
  %223 = or i1 %87, %86
  %or.cond265 = select i1 %223, i1 true, i1 %101
  br i1 %or.cond265, label %224, label %460

224:                                              ; preds = %222, %196
  br i1 %101, label %225, label %400

225:                                              ; preds = %224
  %226 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.37)
  store i32 0, ptr %5, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #11
  %227 = load ptr, ptr %4, align 8, !tbaa !5
  %228 = call i32 @mdbx_cursor_open(ptr noundef %227, i32 noundef 0, ptr noundef nonnull %8) #11
  %.not249 = icmp eq i32 %228, 0
  br i1 %.not249, label %229, label %.thread273, !prof !34

.thread273:                                       ; preds = %225
  call void @error(ptr noundef nonnull @.str.38, i32 noundef %228)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #11
  br label %460

229:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #11
  %230 = load ptr, ptr %4, align 8, !tbaa !5
  %231 = call i32 @mdbx_dbi_stat(ptr noundef %230, i32 noundef 0, ptr noundef nonnull %9, i64 noundef 48) #11
  %.not250 = icmp eq i32 %231, 0
  br i1 %.not250, label %232, label %.thread276, !prof !34

.thread276:                                       ; preds = %229
  call void @error(ptr noundef nonnull @.str.39, i32 noundef %231)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #11
  br label %460

232:                                              ; preds = %229
  call void @print_stat(ptr noundef nonnull %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #11
  %233 = load ptr, ptr %8, align 8, !tbaa !5
  %234 = call i32 @mdbx_cursor_get(ptr noundef %233, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef 8) #11
  %235 = icmp eq i32 %234, 0
  br i1 %235, label %.lr.ph342, label %._crit_edge343

.lr.ph342:                                        ; preds = %232
  %236 = getelementptr inbounds i8, ptr %6, i64 64
  %237 = icmp sgt i32 %.0203, 1
  %238 = getelementptr inbounds i8, ptr %6, i64 48
  %.not252 = icmp ne i32 %.0203, 2
  br i1 %237, label %.lr.ph342.split.us, label %.lr.ph342.split

.lr.ph342.split.us:                               ; preds = %.lr.ph342, %.loopexit.us
  %.0191340.us = phi i32 [ %.1192.us, %.loopexit.us ], [ 0, %.lr.ph342 ]
  %.0193339.us = phi i32 [ %244, %.loopexit.us ], [ 0, %.lr.ph342 ]
  %239 = load volatile i32, ptr @user_break, align 4, !tbaa !30
  %.not251.us = icmp eq i32 %239, 0
  br i1 %.not251.us, label %240, label %.thread269

240:                                              ; preds = %.lr.ph342.split.us
  %241 = load ptr, ptr %11, align 8, !tbaa !64
  %242 = getelementptr inbounds i8, ptr %241, i64 4
  %243 = load i32, ptr %241, align 4, !tbaa !30
  %244 = add i32 %243, %.0193339.us
  br i1 %.0207, label %245, label %251

245:                                              ; preds = %240
  %246 = load i64, ptr %236, align 8, !tbaa !61
  %247 = load ptr, ptr %10, align 8, !tbaa !64
  %248 = load i64, ptr %247, align 8, !tbaa !66
  %249 = icmp ugt i64 %246, %248
  %250 = select i1 %249, i32 %243, i32 0
  %spec.select.us = add i32 %250, %.0191340.us
  br label %251

251:                                              ; preds = %245, %240
  %.1192.us = phi i32 [ %.0191340.us, %240 ], [ %spec.select.us, %245 ]
  %.not = icmp eq i32 %243, 0
  br i1 %.not, label %._crit_edge.us, label %.lr.ph326.us.preheader

.lr.ph326.us.preheader:                           ; preds = %251
  %252 = load i64, ptr %238, align 8, !tbaa !67
  %253 = trunc i64 %252 to i32
  %254 = add i32 %253, 1
  %wide.trip.count = zext i32 %243 to i64
  br label %.lr.ph326.us

._crit_edge.us:                                   ; preds = %.critedge.us, %251
  %.0187.lcssa.us = phi ptr [ @.str.40, %251 ], [ %spec.select266.us, %.critedge.us ]
  %.0183.lcssa.us = phi i32 [ 1, %251 ], [ %.1184.lcssa.us, %.critedge.us ]
  %255 = load ptr, ptr %10, align 8, !tbaa !64
  %256 = load i64, ptr %255, align 8, !tbaa !66
  %257 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.42, i64 noundef %256, i32 noundef %243, i32 noundef %.0183.lcssa.us, ptr noundef %.0187.lcssa.us)
  %258 = icmp ne i32 %243, 0
  %or.cond360 = select i1 %.not252, i1 %258, i1 false
  br i1 %or.cond360, label %.lr.ph338.us, label %.loopexit.us

.lr.ph338.us:                                     ; preds = %._crit_edge.us, %276
  %.0179337.us = phi i32 [ %.lcssa307.us393, %276 ], [ 0, %._crit_edge.us ]
  %259 = zext i32 %.0179337.us to i64
  %260 = getelementptr inbounds i32, ptr %242, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !30
  %262 = add nuw i32 %.0179337.us, 1
  %263 = icmp ult i32 %262, %243
  br i1 %263, label %.lr.ph331.us, label %.critedge13.us.thread

264:                                              ; preds = %.lr.ph331.us, %278
  %265 = phi i32 [ %262, %.lr.ph331.us ], [ %280, %278 ]
  %.2185329.us = phi i32 [ 1, %.lr.ph331.us ], [ %279, %278 ]
  %266 = zext i32 %265 to i64
  %267 = getelementptr inbounds i32, ptr %242, i64 %266
  %268 = load i32, ptr %267, align 4, !tbaa !30
  %269 = zext i32 %.2185329.us to i64
  %270 = call i32 @pgno_sub(i64 noundef %302, i64 noundef %269) #12
  %271 = icmp eq i32 %268, %270
  br i1 %271, label %278, label %.critedge13.us

.critedge13.us:                                   ; preds = %264, %278
  %.2185.lcssa.us = phi i32 [ %.2185329.us, %264 ], [ %303, %278 ]
  %.lcssa307.us = phi i32 [ %265, %264 ], [ %243, %278 ]
  %272 = icmp ugt i32 %.2185.lcssa.us, 1
  br i1 %272, label %274, label %.critedge13.us.thread

.critedge13.us.thread:                            ; preds = %.lr.ph338.us, %.critedge13.us
  %.lcssa307.us394 = phi i32 [ %.lcssa307.us, %.critedge13.us ], [ %262, %.lr.ph338.us ]
  %273 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.44, i32 noundef %261)
  br label %276

274:                                              ; preds = %.critedge13.us
  %275 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.43, i32 noundef %261, i32 noundef %.2185.lcssa.us)
  br label %276

276:                                              ; preds = %274, %.critedge13.us.thread
  %.lcssa307.us393 = phi i32 [ %.lcssa307.us, %274 ], [ %.lcssa307.us394, %.critedge13.us.thread ]
  %277 = icmp ult i32 %.lcssa307.us393, %243
  br i1 %277, label %.lr.ph338.us, label %.loopexit.us, !llvm.loop !68

278:                                              ; preds = %264
  %279 = add i32 %.2185329.us, 1
  %280 = add i32 %279, %.0179337.us
  %exitcond387.not = icmp eq i32 %279, %303
  br i1 %exitcond387.not, label %.critedge13.us, label %264, !llvm.loop !69

.loopexit.us:                                     ; preds = %276, %._crit_edge.us
  %281 = load ptr, ptr %8, align 8, !tbaa !5
  %282 = call i32 @mdbx_cursor_get(ptr noundef %281, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef 8) #11
  %283 = icmp eq i32 %282, 0
  br i1 %283, label %.lr.ph342.split.us, label %._crit_edge343, !llvm.loop !70

.lr.ph326.us:                                     ; preds = %.lr.ph326.us.preheader, %.critedge.us
  %indvars.iv384 = phi i64 [ 0, %.lr.ph326.us.preheader ], [ %indvars.iv.next385, %.critedge.us ]
  %indvars.iv = phi i32 [ %243, %.lr.ph326.us.preheader ], [ %indvars.iv.next, %.critedge.us ]
  %.0183324.us = phi i32 [ 1, %.lr.ph326.us.preheader ], [ %.1184.lcssa.us, %.critedge.us ]
  %.0186323.us = phi i32 [ %254, %.lr.ph326.us.preheader ], [ %285, %.critedge.us ]
  %.0187322.us = phi ptr [ @.str.40, %.lr.ph326.us.preheader ], [ %spec.select266.us, %.critedge.us ]
  %284 = getelementptr inbounds i32, ptr %242, i64 %indvars.iv384
  %285 = load i32, ptr %284, align 4, !tbaa !30
  %.not253.us = icmp ugt i32 %.0186323.us, %285
  %spec.select266.us = select i1 %.not253.us, ptr %.0187322.us, ptr @.str.41
  %286 = trunc nuw i64 %indvars.iv384 to i32
  %287 = add i32 %.0183324.us, %286
  %288 = icmp ult i32 %287, %243
  br i1 %288, label %.lr.ph.us, label %.critedge.us

289:                                              ; preds = %.lr.ph.us, %297
  %290 = phi i32 [ %287, %.lr.ph.us ], [ %299, %297 ]
  %.1184319.us = phi i32 [ %.0183324.us, %.lr.ph.us ], [ %298, %297 ]
  %291 = zext i32 %290 to i64
  %292 = getelementptr inbounds i32, ptr %242, i64 %291
  %293 = load i32, ptr %292, align 4, !tbaa !30
  %294 = zext i32 %.1184319.us to i64
  %295 = call i32 @pgno_sub(i64 noundef %301, i64 noundef %294) #12
  %296 = icmp eq i32 %293, %295
  br i1 %296, label %297, label %.critedge.us

.critedge.us:                                     ; preds = %289, %297, %.lr.ph326.us
  %.1184.lcssa.us = phi i32 [ %.0183324.us, %.lr.ph326.us ], [ %indvars.iv, %297 ], [ %.1184319.us, %289 ]
  %indvars.iv.next385 = add nuw nsw i64 %indvars.iv384, 1
  %indvars.iv.next = add i32 %indvars.iv, -1
  %exitcond.not = icmp eq i64 %indvars.iv.next385, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %.lr.ph326.us, !llvm.loop !71

297:                                              ; preds = %289
  %298 = add i32 %.1184319.us, 1
  %299 = add i32 %298, %286
  %300 = icmp ult i32 %299, %243
  br i1 %300, label %289, label %.critedge.us, !llvm.loop !72

.lr.ph.us:                                        ; preds = %.lr.ph326.us
  %301 = zext i32 %285 to i64
  br label %289

.lr.ph331.us:                                     ; preds = %.lr.ph338.us
  %302 = zext i32 %261 to i64
  %303 = sub i32 %243, %.0179337.us
  br label %264

.lr.ph342.split:                                  ; preds = %.lr.ph342
  br i1 %.0207, label %.lr.ph342.split.split.us, label %.lr.ph342.split.split

.lr.ph342.split.split.us:                         ; preds = %.lr.ph342.split, %305
  %.0191340.us349 = phi i32 [ %spec.select.us352, %305 ], [ 0, %.lr.ph342.split ]
  %.0193339.us350 = phi i32 [ %308, %305 ], [ 0, %.lr.ph342.split ]
  %304 = load volatile i32, ptr @user_break, align 4, !tbaa !30
  %.not251.us351 = icmp eq i32 %304, 0
  br i1 %.not251.us351, label %305, label %.thread269

305:                                              ; preds = %.lr.ph342.split.split.us
  %306 = load ptr, ptr %11, align 8, !tbaa !64
  %307 = load i32, ptr %306, align 4, !tbaa !30
  %308 = add i32 %307, %.0193339.us350
  %309 = load i64, ptr %236, align 8, !tbaa !61
  %310 = load ptr, ptr %10, align 8, !tbaa !64
  %311 = load i64, ptr %310, align 8, !tbaa !66
  %312 = icmp ugt i64 %309, %311
  %313 = select i1 %312, i32 %307, i32 0
  %spec.select.us352 = add i32 %313, %.0191340.us349
  %314 = load ptr, ptr %8, align 8, !tbaa !5
  %315 = call i32 @mdbx_cursor_get(ptr noundef %314, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef 8) #11
  %316 = icmp eq i32 %315, 0
  br i1 %316, label %.lr.ph342.split.split.us, label %._crit_edge343, !llvm.loop !70

.lr.ph342.split.split:                            ; preds = %.lr.ph342.split, %319
  %.0193339 = phi i32 [ %322, %319 ], [ 0, %.lr.ph342.split ]
  %317 = load volatile i32, ptr @user_break, align 4, !tbaa !30
  %.not251 = icmp eq i32 %317, 0
  br i1 %.not251, label %319, label %.thread269

.thread269:                                       ; preds = %.lr.ph342.split.split, %.lr.ph342.split.split.us, %.lr.ph342.split.us
  %318 = load ptr, ptr %8, align 8, !tbaa !5
  call void @mdbx_cursor_close(ptr noundef %318) #11
  store ptr null, ptr %8, align 8, !tbaa !5
  br label %327

319:                                              ; preds = %.lr.ph342.split.split
  %320 = load ptr, ptr %11, align 8, !tbaa !64
  %321 = load i32, ptr %320, align 4, !tbaa !30
  %322 = add i32 %321, %.0193339
  %323 = load ptr, ptr %8, align 8, !tbaa !5
  %324 = call i32 @mdbx_cursor_get(ptr noundef %323, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef 8) #11
  %325 = icmp eq i32 %324, 0
  br i1 %325, label %.lr.ph342.split.split, label %._crit_edge343, !llvm.loop !70

._crit_edge343:                                   ; preds = %319, %305, %.loopexit.us, %232
  %.0193.lcssa = phi i32 [ 0, %232 ], [ %244, %.loopexit.us ], [ %308, %305 ], [ %322, %319 ]
  %.0191.lcssa = phi i32 [ 0, %232 ], [ %.1192.us, %.loopexit.us ], [ %spec.select.us352, %305 ], [ 0, %319 ]
  %.lcssa308 = phi i32 [ %234, %232 ], [ %282, %.loopexit.us ], [ %315, %305 ], [ %324, %319 ]
  %326 = load ptr, ptr %8, align 8, !tbaa !5
  call void @mdbx_cursor_close(ptr noundef %326) #11
  store ptr null, ptr %8, align 8, !tbaa !5
  switch i32 %.lcssa308, label %333 [
    i32 4, label %327
    i32 -30798, label %334
  ]

327:                                              ; preds = %._crit_edge343, %.thread269
  %328 = load i8, ptr @quiet, align 1, !tbaa !26, !range !32, !noundef !33
  %329 = trunc nuw i8 %328 to i1
  br i1 %329, label %.thread280, label %330

330:                                              ; preds = %327
  %331 = load ptr, ptr @stderr, align 8, !tbaa !5
  %332 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %331, ptr noundef nonnull @.str.45) #13
  br label %.thread280

333:                                              ; preds = %._crit_edge343
  call void @error(ptr noundef nonnull @.str.46, i32 noundef %.lcssa308)
  br label %.thread280

334:                                              ; preds = %._crit_edge343
  br i1 %.0207, label %335, label %397

335:                                              ; preds = %334
  %336 = getelementptr inbounds i8, ptr %6, i64 40
  %337 = load i64, ptr %336, align 8, !tbaa !58
  %338 = getelementptr inbounds i8, ptr %6, i64 136
  %339 = load i32, ptr %338, align 8, !tbaa !53
  %340 = zext i32 %339 to i64
  %341 = udiv i64 %337, %340
  %342 = uitofp i64 %341 to double
  %343 = fdiv double %342, 1.000000e+02
  %344 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.47)
  %345 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48, i64 noundef %341)
  %346 = getelementptr inbounds i8, ptr %6, i64 16
  %347 = load i64, ptr %346, align 8, !tbaa !59
  %348 = load i32, ptr %338, align 8, !tbaa !53
  %349 = zext i32 %348 to i64
  %350 = udiv i64 %347, %349
  %351 = uitofp i64 %350 to double
  %352 = fdiv double %351, %343
  %353 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.49, i64 noundef %350, double noundef %352)
  %354 = getelementptr inbounds i8, ptr %6, i64 48
  %355 = load i64, ptr %354, align 8, !tbaa !67
  %356 = add i64 %355, 1
  %357 = uitofp i64 %356 to double
  %358 = fdiv double %357, %343
  %359 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.50, i64 noundef %356, double noundef %358)
  %360 = load i64, ptr %336, align 8, !tbaa !58
  %361 = load i32, ptr %338, align 8, !tbaa !53
  %362 = zext i32 %361 to i64
  %363 = udiv i64 %360, %362
  %364 = load i64, ptr %354, align 8, !tbaa !67
  %.neg = xor i64 %364, -1
  %365 = add i64 %363, %.neg
  %366 = uitofp i64 %365 to double
  %367 = fdiv double %366, %343
  %368 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.51, i64 noundef %365, double noundef %367)
  %369 = load i64, ptr %354, align 8, !tbaa !67
  %370 = zext i32 %.0193.lcssa to i64
  %reass.sub = sub i64 %369, %370
  %371 = add i64 %reass.sub, 1
  %372 = uitofp i64 %371 to double
  %373 = fdiv double %372, %343
  %374 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.52, i64 noundef %371, double noundef %373)
  %375 = uitofp i32 %.0193.lcssa to double
  %376 = fdiv double %375, %343
  %377 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.53, i64 noundef %370, double noundef %376)
  %378 = sub i32 %.0193.lcssa, %.0191.lcssa
  %379 = zext i32 %378 to i64
  %380 = uitofp i32 %378 to double
  %381 = fdiv double %380, %343
  %382 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.54, i64 noundef %379, double noundef %381)
  %383 = zext i32 %.0191.lcssa to i64
  %384 = uitofp i32 %.0191.lcssa to double
  %385 = fdiv double %384, %343
  %386 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.55, i64 noundef %383, double noundef %385)
  %387 = load i64, ptr %336, align 8, !tbaa !58
  %388 = load i32, ptr %338, align 8, !tbaa !53
  %389 = zext i32 %388 to i64
  %390 = udiv i64 %387, %389
  %391 = load i64, ptr %354, align 8, !tbaa !67
  %.neg254 = xor i64 %391, -1
  %392 = add i64 %390, %383
  %393 = add i64 %392, %.neg254
  %394 = uitofp i64 %393 to double
  %395 = fdiv double %394, %343
  %396 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.56, i64 noundef %393, double noundef %395)
  br label %399

397:                                              ; preds = %334
  %398 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.57, i32 noundef %.0193.lcssa)
  br label %399

.thread280:                                       ; preds = %333, %330, %327
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #11
  br label %460

399:                                              ; preds = %397, %335
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #11
  br label %400

400:                                              ; preds = %399, %224
  %401 = load ptr, ptr %4, align 8, !tbaa !5
  %402 = call i32 @mdbx_dbi_open(ptr noundef %401, ptr noundef %.0180, i32 noundef 1073741824, ptr noundef nonnull %5) #11
  %.not255 = icmp eq i32 %402, 0
  br i1 %.not255, label %404, label %403, !prof !34

403:                                              ; preds = %400
  call void @error(ptr noundef nonnull @.str.58, i32 noundef %402)
  br label %460

404:                                              ; preds = %400
  %405 = load ptr, ptr %4, align 8, !tbaa !5
  %406 = load i32, ptr %5, align 4, !tbaa !30
  %407 = call i32 @mdbx_dbi_stat(ptr noundef %405, i32 noundef %406, ptr noundef nonnull %12, i64 noundef 48) #11
  %.not256 = icmp eq i32 %407, 0
  br i1 %.not256, label %409, label %408, !prof !34

408:                                              ; preds = %404
  call void @error(ptr noundef nonnull @.str.39, i32 noundef %407)
  br label %460

409:                                              ; preds = %404
  %410 = select i1 %87, ptr %.0180, ptr @.str.60
  %411 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.59, ptr noundef nonnull %410)
  call void @print_stat(ptr noundef nonnull %12)
  br i1 %86, label %412, label %.thread294

412:                                              ; preds = %409
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #11
  %413 = load ptr, ptr %4, align 8, !tbaa !5
  %414 = load i32, ptr %5, align 4, !tbaa !30
  %415 = call i32 @mdbx_cursor_open(ptr noundef %413, i32 noundef %414, ptr noundef nonnull %13) #11
  %.not257 = icmp eq i32 %415, 0
  br i1 %.not257, label %416, label %.thread288, !prof !34

.thread288:                                       ; preds = %412
  call void @error(ptr noundef nonnull @.str.38, i32 noundef %415)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #11
  br label %460

416:                                              ; preds = %412
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #11
  %417 = load ptr, ptr %13, align 8, !tbaa !5
  %418 = call i32 @mdbx_cursor_get(ptr noundef %417, ptr noundef nonnull %14, ptr noundef null, i32 noundef 11) #11
  %419 = icmp eq i32 %418, 0
  br i1 %419, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %416
  %420 = getelementptr inbounds i8, ptr %14, i64 8
  br label %421

421:                                              ; preds = %.lr.ph, %444
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #11
  %422 = load ptr, ptr %14, align 8, !tbaa !64
  %423 = load i64, ptr %420, align 8, !tbaa !73
  %424 = call ptr @memchr(ptr noundef %422, i32 noundef 0, i64 noundef %423) #14
  %.not258 = icmp eq ptr %424, null
  br i1 %.not258, label %425, label %444, !llvm.loop !74

425:                                              ; preds = %421
  %426 = add i64 %423, 1
  %427 = call noalias ptr @malloc(i64 noundef %426) #15
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %427, ptr align 1 %422, i64 %423, i1 false)
  %428 = getelementptr inbounds i8, ptr %427, i64 %423
  store i8 0, ptr %428, align 1, !tbaa !75
  %429 = load ptr, ptr %4, align 8, !tbaa !5
  %430 = call i32 @mdbx_dbi_open(ptr noundef %429, ptr noundef %427, i32 noundef 1073741824, ptr noundef nonnull %15) #11
  %431 = icmp eq i32 %430, 0
  br i1 %431, label %.thread283, label %436

.thread283:                                       ; preds = %425
  %432 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.59, ptr noundef nonnull %427)
  call void @free(ptr noundef nonnull %427) #11
  %433 = load ptr, ptr %4, align 8, !tbaa !5
  %434 = load i32, ptr %15, align 4, !tbaa !30
  %435 = call i32 @mdbx_dbi_stat(ptr noundef %433, i32 noundef %434, ptr noundef nonnull %12, i64 noundef 48) #11
  %.not260 = icmp eq i32 %435, 0
  br i1 %.not260, label %439, label %438, !prof !34

436:                                              ; preds = %425
  call void @free(ptr noundef nonnull %427) #11
  %cond = icmp eq i32 %430, -30784
  br i1 %cond, label %444, label %437, !prof !76

437:                                              ; preds = %436
  call void @error(ptr noundef nonnull @.str.58, i32 noundef %430)
  br label %448

438:                                              ; preds = %.thread283
  call void @error(ptr noundef nonnull @.str.39, i32 noundef %435)
  br label %448

439:                                              ; preds = %.thread283
  call void @print_stat(ptr noundef nonnull %12)
  %440 = load ptr, ptr %3, align 8, !tbaa !5
  %441 = load i32, ptr %15, align 4, !tbaa !30
  %442 = call i32 @mdbx_dbi_close(ptr noundef %440, i32 noundef %441) #11
  %.not261 = icmp eq i32 %442, 0
  br i1 %.not261, label %444, label %443, !prof !34

443:                                              ; preds = %439
  call void @error(ptr noundef nonnull @.str.61, i32 noundef %442)
  br label %448

444:                                              ; preds = %436, %439, %421
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #11
  %445 = load ptr, ptr %13, align 8, !tbaa !5
  %446 = call i32 @mdbx_cursor_get(ptr noundef %445, ptr noundef nonnull %14, ptr noundef null, i32 noundef 11) #11
  %447 = icmp eq i32 %446, 0
  br i1 %447, label %421, label %._crit_edge

448:                                              ; preds = %437, %438, %443
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #11
  br label %460

._crit_edge:                                      ; preds = %444, %416
  %.lcssa = phi i32 [ %418, %416 ], [ %446, %444 ]
  %449 = load ptr, ptr %13, align 8, !tbaa !5
  call void @mdbx_cursor_close(ptr noundef %449) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #11
  switch i32 %.lcssa, label %456 [
    i32 4, label %450
    i32 -30798, label %.thread294
  ]

450:                                              ; preds = %._crit_edge
  %451 = load i8, ptr @quiet, align 1, !tbaa !26, !range !32, !noundef !33
  %452 = trunc nuw i8 %451 to i1
  br i1 %452, label %.thread294, label %453

453:                                              ; preds = %450
  %454 = load ptr, ptr @stderr, align 8, !tbaa !5
  %455 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %454, ptr noundef nonnull @.str.45) #13
  br label %.thread294

456:                                              ; preds = %._crit_edge
  call void @error(ptr noundef nonnull @.str.46, i32 noundef %.lcssa)
  br label %.thread294

.thread294:                                       ; preds = %409, %456, %450, %453, %._crit_edge
  %.9296 = phi i32 [ %.lcssa, %456 ], [ 4, %450 ], [ 4, %453 ], [ %.lcssa, %._crit_edge ], [ 0, %409 ]
  %457 = load ptr, ptr %3, align 8, !tbaa !5
  %458 = load i32, ptr %5, align 4, !tbaa !30
  %459 = call i32 @mdbx_dbi_close(ptr noundef %457, i32 noundef %458) #11
  br label %460

460:                                              ; preds = %448, %.thread288, %.thread280, %.thread276, %.thread273, %221, %222, %.thread294, %408, %403, %201, %108, %99
  %.10 = phi i32 [ 1, %99 ], [ 1, %108 ], [ %199, %201 ], [ 1, %403 ], [ 1, %408 ], [ 1, %448 ], [ %.9296, %.thread294 ], [ %210, %221 ], [ %.2, %222 ], [ 1, %.thread273 ], [ 1, %.thread276 ], [ 1, %.thread280 ], [ 1, %.thread288 ]
  %461 = load ptr, ptr %4, align 8, !tbaa !5
  %462 = call i32 @mdbx_txn_abort(ptr noundef %461) #11
  %463 = icmp ne i32 %.10, 0
  %464 = zext i1 %463 to i32
  br label %465

465:                                              ; preds = %460, %95, %91
  %.11 = phi i32 [ 1, %91 ], [ 1, %95 ], [ %464, %460 ]
  %466 = load ptr, ptr %3, align 8, !tbaa !5
  %467 = call i32 @mdbx_env_close(ptr noundef %466) #11
  br label %468

468:                                              ; preds = %465, %84, %21
  %.0 = phi i32 [ 0, %21 ], [ 1, %84 ], [ %.11, %465 ]
  call void @llvm.lifetime.end.p0(i64 352, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #11
  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: nounwind uwtable
declare hidden void @usage(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @signal_handler(i32 noundef) #0

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

declare i32 @mdbx_setup_debug(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @logger(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

declare i32 @mdbx_env_create(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @error(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @mdbx_env_set_maxdbs(ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @mdbx_env_open(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

declare i32 @mdbx_txn_begin(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

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

declare i32 @mdbx_reader_list(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i32 @reader_list_func(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #0

declare i32 @mdbx_reader_check(ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @mdbx_cursor_open(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare hidden void @print_stat(ptr noundef) local_unnamed_addr #0

declare i32 @mdbx_cursor_get(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare hidden i32 @pgno_sub(i64 noundef, i64 noundef) local_unnamed_addr #6

declare void @mdbx_cursor_close(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare i32 @mdbx_dbi_open(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @memchr(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #8

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #10

declare i32 @mdbx_dbi_close(ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @mdbx_txn_abort(ptr noundef) local_unnamed_addr #4

declare i32 @mdbx_env_close(ptr noundef) local_unnamed_addr #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "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 = { nofree nounwind "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { inlinehint mustprogress nofree nosync nounwind willreturn memory(none) 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 #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #8 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #9 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(none) }
attributes #13 = { cold nounwind }
attributes #14 = { nounwind willreturn memory(read) }
attributes #15 = { nounwind allocsize(0) }

!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, !11, i64 0}
!10 = !{!"MDBX_version_info", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !6, i64 8, !12, i64 16, !6, i64 48}
!11 = !{!"short", !7, i64 0}
!12 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!13 = !{!10, !11, i64 2}
!14 = !{!10, !11, i64 4}
!15 = !{!10, !11, i64 6}
!16 = !{!10, !6, i64 40}
!17 = !{!10, !6, i64 16}
!18 = !{!10, !6, i64 32}
!19 = !{!10, !6, i64 24}
!20 = !{!21, !6, i64 0}
!21 = !{!"MDBX_build_info", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!22 = !{!21, !6, i64 8}
!23 = !{!21, !6, i64 24}
!24 = !{!21, !6, i64 32}
!25 = !{!21, !6, i64 16}
!26 = !{!27, !27, i64 0}
!27 = !{!"_Bool", !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !31, i64 0}
!31 = !{!"int", !7, i64 0}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!35 = !{!36, !38, i64 240}
!36 = !{!"MDBX_envinfo", !37, i64 0, !38, i64 40, !38, i64 48, !38, i64 56, !38, i64 64, !38, i64 72, !7, i64 80, !7, i64 104, !31, i64 128, !31, i64 132, !31, i64 136, !31, i64 140, !39, i64 144, !38, i64 208, !38, i64 216, !31, i64 224, !31, i64 228, !31, i64 232, !31, i64 236, !41, i64 240, !40, i64 336}
!37 = !{!"", !38, i64 0, !38, i64 8, !38, i64 16, !38, i64 24, !38, i64 32}
!38 = !{!"long", !7, i64 0}
!39 = !{!"", !40, i64 0, !7, i64 16}
!40 = !{!"", !38, i64 0, !38, i64 8}
!41 = !{!"", !38, i64 0, !38, i64 8, !38, i64 16, !38, i64 24, !38, i64 32, !38, i64 40, !38, i64 48, !38, i64 56, !38, i64 64, !38, i64 72, !38, i64 80, !38, i64 88}
!42 = !{!36, !38, i64 248}
!43 = !{!36, !38, i64 256}
!44 = !{!36, !38, i64 264}
!45 = !{!36, !38, i64 272}
!46 = !{!36, !38, i64 280}
!47 = !{!36, !38, i64 288}
!48 = !{!36, !38, i64 296}
!49 = !{!36, !38, i64 304}
!50 = !{!36, !38, i64 312}
!51 = !{!36, !38, i64 320}
!52 = !{!36, !38, i64 328}
!53 = !{!36, !31, i64 136}
!54 = !{!36, !38, i64 0}
!55 = !{!36, !38, i64 8}
!56 = !{!36, !38, i64 32}
!57 = !{!36, !38, i64 24}
!58 = !{!36, !38, i64 40}
!59 = !{!36, !38, i64 16}
!60 = !{!36, !38, i64 56}
!61 = !{!36, !38, i64 64}
!62 = !{!36, !31, i64 128}
!63 = !{!36, !31, i64 132}
!64 = !{!65, !6, i64 0}
!65 = !{!"iovec", !6, i64 0, !38, i64 8}
!66 = !{!38, !38, i64 0}
!67 = !{!36, !38, i64 48}
!68 = distinct !{!68, !29}
!69 = distinct !{!69, !29}
!70 = distinct !{!70, !29}
!71 = distinct !{!71, !29}
!72 = distinct !{!72, !29}
!73 = !{!65, !38, i64 8}
!74 = distinct !{!74, !29}
!75 = !{!7, !7, i64 0}
!76 = !{!"branch_weights", i32 858564, i32 858564}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass