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

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

@prog = external hidden global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = 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
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@quiet = external hidden global i8, align 1
@stderr = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@subname = external hidden global ptr, align 8
@mode = external hidden global i32, align 4
@optind = external global i32, align 4
@.str.11 = external hidden unnamed_addr constant [43 x i8], align 1
@dbuf = external hidden global %struct.iovec, align 8
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@envinfo = external hidden global %struct.MDBX_envinfo, align 8
@.str.16 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@kbuf = external hidden global %struct.iovec, align 8
@.str.20 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@user_break = external hidden global i32, align 4
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@canary = external hidden global %struct.MDBX_canary, align 8
@.str.23 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [6 x i8], align 1
@dbi_flags = external hidden global i32, align 4
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [18 x i8], align 1
@sequence = external hidden global i64, align 8
@.str.27 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@lineno = external hidden global i64, align 8
@.str.31 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [66 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [23 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [9 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 ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca %struct.iovec, align 8
  %22 = alloca %struct.iovec, align 8
  %23 = alloca %struct.MDBX_txn_info, align 8
  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) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #11
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #11
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #11
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #11
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #11
  store i32 1073807360, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #11
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #11
  store i8 0, ptr %15, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #11
  store i8 0, ptr %16, align 1, !tbaa !11
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  store ptr %26, ptr @prog, align 8, !tbaa !9
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 2
  br i1 %28, label %29, label %30

29:                                               ; preds = %2
  call void @usage()
  br label %30

30:                                               ; preds = %29, %2
  br label %31

31:                                               ; preds = %95, %30
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = call i32 @getopt(i32 noundef %32, ptr noundef %33, ptr noundef @.str.7) #11
  store i32 %34, ptr %6, align 4, !tbaa !5
  %35 = icmp ne i32 %34, -1
  br i1 %35, label %36, label %96

36:                                               ; preds = %31
  %37 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %37, label %94 [
    i32 86, label %38
    i32 97, label %58
    i32 102, label %61
    i32 110, label %79
    i32 115, label %82
    i32 78, label %85
    i32 112, label %88
    i32 84, label %89
    i32 113, label %92
    i32 114, label %93
  ]

38:                                               ; preds = %36
  %39 = load i16, ptr @mdbx_version, align 8, !tbaa !13
  %40 = zext i16 %39 to i32
  %41 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 1), align 2, !tbaa !17
  %42 = zext i16 %41 to i32
  %43 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 2), align 4, !tbaa !18
  %44 = zext i16 %43 to i32
  %45 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 3), align 2, !tbaa !19
  %46 = zext i16 %45 to i32
  %47 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 3), align 8, !tbaa !20
  %48 = load ptr, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), align 8, !tbaa !21
  %49 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 2), align 8, !tbaa !22
  %50 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 1), align 8, !tbaa !23
  %51 = load ptr, ptr @mdbx_sourcery_MDBX_BUILD_SOURCERY, align 8, !tbaa !9
  %52 = load ptr, ptr @mdbx_build, align 8, !tbaa !24
  %53 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 1), align 8, !tbaa !26
  %54 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 3), align 8, !tbaa !27
  %55 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 4), align 8, !tbaa !28
  %56 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 2), align 8, !tbaa !29
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %40, i32 noundef %42, i32 noundef %44, i32 noundef %46, ptr noundef %47, ptr noundef %48, ptr noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %52, ptr noundef %53, ptr noundef %54, ptr noundef %55, ptr noundef %56)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %717

58:                                               ; preds = %36
  %59 = load i32, ptr %14, align 4, !tbaa !5
  %60 = or i32 %59, 131072
  store i32 %60, ptr %14, align 4, !tbaa !5
  br label %95

61:                                               ; preds = %36
  %62 = load ptr, ptr @optarg, align 8, !tbaa !9
  %63 = load ptr, ptr @stdin, align 8, !tbaa !9
  %64 = call ptr @freopen64(ptr noundef %62, ptr noundef @.str.9, ptr noundef %63)
  %65 = icmp eq ptr %64, null
  br i1 %65, label %66, label %78

66:                                               ; preds = %61
  %67 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %68 = trunc i8 %67 to i1
  br i1 %68, label %77, label %69

69:                                               ; preds = %66
  %70 = load ptr, ptr @stderr, align 8, !tbaa !9
  %71 = load ptr, ptr @prog, align 8, !tbaa !9
  %72 = load ptr, ptr @optarg, align 8, !tbaa !9
  %73 = call ptr @__errno_location() #12
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = call ptr @mdbx_strerror(i32 noundef %74)
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.10, ptr noundef %71, ptr noundef %72, ptr noundef %75) #11
  br label %77

77:                                               ; preds = %69, %66
  call void @exit(i32 noundef 1) #13
  unreachable

78:                                               ; preds = %61
  br label %95

79:                                               ; preds = %36
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = or i32 %80, 16384
  store i32 %81, ptr %13, align 4, !tbaa !5
  br label %95

82:                                               ; preds = %36
  %83 = load ptr, ptr @optarg, align 8, !tbaa !9
  %84 = call noalias ptr @strdup(ptr noundef %83) #11
  store ptr %84, ptr @subname, align 8, !tbaa !9
  br label %95

85:                                               ; preds = %36
  %86 = load i32, ptr %14, align 4, !tbaa !5
  %87 = or i32 %86, 48
  store i32 %87, ptr %14, align 4, !tbaa !5
  br label %95

88:                                               ; preds = %36
  store i8 1, ptr %16, align 1, !tbaa !11
  br label %95

89:                                               ; preds = %36
  %90 = load i32, ptr @mode, align 4, !tbaa !5
  %91 = or i32 %90, 3
  store i32 %91, ptr @mode, align 4, !tbaa !5
  br label %95

92:                                               ; preds = %36
  store i8 1, ptr @quiet, align 1, !tbaa !11
  br label %95

93:                                               ; preds = %36
  store i8 1, ptr %15, align 1, !tbaa !11
  br label %95

94:                                               ; preds = %36
  call void @usage()
  br label %95

95:                                               ; preds = %94, %93, %92, %89, %88, %85, %82, %79, %78, %58
  br label %31, !llvm.loop !32

96:                                               ; preds = %31
  %97 = load i32, ptr @optind, align 4, !tbaa !5
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = sub nsw i32 %98, 1
  %100 = icmp ne i32 %97, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %96
  call void @usage()
  br label %102

102:                                              ; preds = %101, %96
  %103 = call ptr @signal(i32 noundef 13, ptr noundef @signal_handler) #11
  %104 = call ptr @signal(i32 noundef 1, ptr noundef @signal_handler) #11
  %105 = call ptr @signal(i32 noundef 2, ptr noundef @signal_handler) #11
  %106 = call ptr @signal(i32 noundef 15, ptr noundef @signal_handler) #11
  %107 = load ptr, ptr %5, align 8, !tbaa !9
  %108 = load i32, ptr @optind, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds ptr, ptr %107, i64 %109
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  store ptr %111, ptr %12, align 8, !tbaa !9
  %112 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %113 = trunc i8 %112 to i1
  br i1 %113, label %122, label %114

114:                                              ; preds = %102
  %115 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 3), align 8, !tbaa !20
  %116 = load ptr, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), align 8, !tbaa !21
  %117 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), i32 0, i32 1), align 8, !tbaa !23
  %118 = load ptr, ptr %12, align 8, !tbaa !9
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %115, ptr noundef %116, ptr noundef %117, ptr noundef %118)
  %120 = call i32 @fflush(ptr noundef null)
  %121 = call i32 @mdbx_setup_debug(i32 noundef 3, i32 noundef -1, ptr noundef @logger)
  br label %122

122:                                              ; preds = %114, %102
  store i64 4096, ptr getelementptr inbounds (%struct.iovec, ptr @dbuf, i32 0, i32 1), align 8, !tbaa !34
  %123 = load i64, ptr getelementptr inbounds (%struct.iovec, ptr @dbuf, i32 0, i32 1), align 8, !tbaa !34
  %124 = call noalias ptr @malloc(i64 noundef %123) #14
  store ptr %124, ptr @dbuf, align 8, !tbaa !37
  %125 = load ptr, ptr @dbuf, align 8, !tbaa !37
  %126 = icmp ne ptr %125, null
  br i1 %126, label %129, label %127

127:                                              ; preds = %122
  store i32 12, ptr %7, align 4, !tbaa !5
  %128 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.12, i32 noundef %128)
  br label %693

129:                                              ; preds = %122
  %130 = load i32, ptr @mode, align 4, !tbaa !5
  %131 = and i32 %130, 2
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %150, label %133

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

143:                                              ; preds = %133
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = icmp eq i32 %144, -1
  br i1 %145, label %146, label %147

146:                                              ; preds = %143
  store i32 61, ptr %7, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %146, %143
  %148 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.13, i32 noundef %148)
  br label %693

149:                                              ; preds = %133
  br label %150

150:                                              ; preds = %149, %129
  %151 = call i32 @mdbx_env_create(ptr noundef %8)
  store i32 %151, ptr %7, align 4, !tbaa !5
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = icmp ne i32 %152, 0
  %154 = xor i1 %153, true
  %155 = xor i1 %154, true
  %156 = zext i1 %155 to i32
  %157 = sext i32 %156 to i64
  %158 = call i64 @llvm.expect.i64(i64 %157, i64 0)
  %159 = icmp ne i64 %158, 0
  br i1 %159, label %160, label %162

160:                                              ; preds = %150
  %161 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.14, i32 noundef %161)
  br label %693

162:                                              ; preds = %150
  %163 = load ptr, ptr %8, align 8, !tbaa !9
  %164 = call i32 @mdbx_env_set_maxdbs(ptr noundef %163, i32 noundef 2)
  store i32 %164, ptr %7, align 4, !tbaa !5
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = icmp ne i32 %165, 0
  %167 = xor i1 %166, true
  %168 = xor i1 %167, true
  %169 = zext i1 %168 to i32
  %170 = sext i32 %169 to i64
  %171 = call i64 @llvm.expect.i64(i64 %170, i64 0)
  %172 = icmp ne i64 %171, 0
  br i1 %172, label %173, label %175

173:                                              ; preds = %162
  %174 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.15, i32 noundef %174)
  br label %693

175:                                              ; preds = %162
  %176 = load i32, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 8), align 8, !tbaa !38
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %193

178:                                              ; preds = %175
  %179 = load ptr, ptr %8, align 8, !tbaa !9
  %180 = load i32, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 8), align 8, !tbaa !38
  %181 = call i32 @mdbx_env_set_maxreaders(ptr noundef %179, i32 noundef %180)
  store i32 %181, ptr %7, align 4, !tbaa !5
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = icmp ne i32 %182, 0
  %184 = xor i1 %183, true
  %185 = xor i1 %184, true
  %186 = zext i1 %185 to i32
  %187 = sext i32 %186 to i64
  %188 = call i64 @llvm.expect.i64(i64 %187, i64 0)
  %189 = icmp ne i64 %188, 0
  br i1 %189, label %190, label %192

190:                                              ; preds = %178
  %191 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.16, i32 noundef %191)
  br label %693

192:                                              ; preds = %178
  br label %193

193:                                              ; preds = %192, %175
  %194 = load i64, ptr getelementptr inbounds (%struct.anon.0, ptr @envinfo, i32 0, i32 2), align 8, !tbaa !44
  %195 = load i64, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 1), align 8, !tbaa !45
  %196 = or i64 %194, %195
  %197 = icmp ne i64 %196, 0
  br i1 %197, label %198, label %254

198:                                              ; preds = %193
  %199 = load i64, ptr getelementptr inbounds (%struct.anon.0, ptr @envinfo, i32 0, i32 2), align 8, !tbaa !44
  %200 = icmp ne i64 %199, 0
  br i1 %200, label %201, label %217

201:                                              ; preds = %198
  %202 = load ptr, ptr %8, align 8, !tbaa !9
  %203 = load i64, ptr @envinfo, align 8, !tbaa !46
  %204 = load i64, ptr getelementptr inbounds (%struct.anon.0, ptr @envinfo, i32 0, i32 2), align 8, !tbaa !44
  %205 = load i64, ptr getelementptr inbounds (%struct.anon.0, ptr @envinfo, i32 0, i32 1), align 8, !tbaa !47
  %206 = load i64, ptr getelementptr inbounds (%struct.anon.0, ptr @envinfo, i32 0, i32 3), align 8, !tbaa !48
  %207 = load i64, ptr getelementptr inbounds (%struct.anon.0, ptr @envinfo, i32 0, i32 4), align 8, !tbaa !49
  %208 = load i32, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 10), align 8, !tbaa !50
  %209 = icmp ne i32 %208, 0
  br i1 %209, label %210, label %213

210:                                              ; preds = %201
  %211 = load i32, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 10), align 8, !tbaa !50
  %212 = zext i32 %211 to i64
  br label %214

213:                                              ; preds = %201
  br label %214

214:                                              ; preds = %213, %210
  %215 = phi i64 [ %212, %210 ], [ -1, %213 ]
  %216 = call i32 @mdbx_env_set_geometry(ptr noundef %202, i64 noundef %203, i64 noundef %204, i64 noundef %205, i64 noundef %206, i64 noundef %207, i64 noundef %215)
  store i32 %216, ptr %7, align 4, !tbaa !5
  br label %242

217:                                              ; preds = %198
  %218 = load i64, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 1), align 8, !tbaa !45
  %219 = icmp ugt i64 %218, 140737488355328
  br i1 %219, label %220, label %228

220:                                              ; preds = %217
  %221 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %222 = trunc i8 %221 to i1
  br i1 %222, label %227, label %223

223:                                              ; preds = %220
  %224 = load ptr, ptr @stderr, align 8, !tbaa !9
  %225 = load i64, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 1), align 8, !tbaa !45
  %226 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %224, ptr noundef @.str.17, i64 noundef %225, i64 noundef 140737488355328) #11
  br label %227

227:                                              ; preds = %223, %220
  br label %693

228:                                              ; preds = %217
  %229 = load ptr, ptr %8, align 8, !tbaa !9
  %230 = load i64, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 1), align 8, !tbaa !45
  %231 = load i64, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 1), align 8, !tbaa !45
  %232 = load i64, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 1), align 8, !tbaa !45
  %233 = load i32, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 10), align 8, !tbaa !50
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %238

235:                                              ; preds = %228
  %236 = load i32, ptr getelementptr inbounds (%struct.MDBX_envinfo, ptr @envinfo, i32 0, i32 10), align 8, !tbaa !50
  %237 = zext i32 %236 to i64
  br label %239

238:                                              ; preds = %228
  br label %239

239:                                              ; preds = %238, %235
  %240 = phi i64 [ %237, %235 ], [ -1, %238 ]
  %241 = call i32 @mdbx_env_set_geometry(ptr noundef %229, i64 noundef %230, i64 noundef %231, i64 noundef %232, i64 noundef 0, i64 noundef 0, i64 noundef %240)
  store i32 %241, ptr %7, align 4, !tbaa !5
  br label %242

242:                                              ; preds = %239, %214
  %243 = load i32, ptr %7, align 4, !tbaa !5
  %244 = icmp ne i32 %243, 0
  %245 = xor i1 %244, true
  %246 = xor i1 %245, true
  %247 = zext i1 %246 to i32
  %248 = sext i32 %247 to i64
  %249 = call i64 @llvm.expect.i64(i64 %248, i64 0)
  %250 = icmp ne i64 %249, 0
  br i1 %250, label %251, label %253

251:                                              ; preds = %242
  %252 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.18, i32 noundef %252)
  br label %693

253:                                              ; preds = %242
  br label %254

254:                                              ; preds = %253, %193
  %255 = load ptr, ptr %8, align 8, !tbaa !9
  %256 = load ptr, ptr %12, align 8, !tbaa !9
  %257 = load i32, ptr %13, align 4, !tbaa !5
  %258 = call i32 @mdbx_env_open(ptr noundef %255, ptr noundef %256, i32 noundef %257, i32 noundef 436)
  store i32 %258, ptr %7, align 4, !tbaa !5
  %259 = load i32, ptr %7, align 4, !tbaa !5
  %260 = icmp ne i32 %259, 0
  %261 = xor i1 %260, true
  %262 = xor i1 %261, true
  %263 = zext i1 %262 to i32
  %264 = sext i32 %263 to i64
  %265 = call i64 @llvm.expect.i64(i64 %264, i64 0)
  %266 = icmp ne i64 %265, 0
  br i1 %266, label %267, label %269

267:                                              ; preds = %254
  %268 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.19, i32 noundef %268)
  br label %693

269:                                              ; preds = %254
  %270 = load ptr, ptr %8, align 8, !tbaa !9
  %271 = call i32 @mdbx_env_get_maxvalsize_ex(ptr noundef %270, i32 noundef 0) #15
  %272 = sext i32 %271 to i64
  %273 = add i64 %272, 1
  store i64 %273, ptr getelementptr inbounds (%struct.iovec, ptr @kbuf, i32 0, i32 1), align 8, !tbaa !34
  %274 = load i64, ptr getelementptr inbounds (%struct.iovec, ptr @kbuf, i32 0, i32 1), align 8, !tbaa !34
  %275 = icmp uge i64 %274, 4611686018427387903
  br i1 %275, label %276, label %284

276:                                              ; preds = %269
  %277 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %278 = trunc i8 %277 to i1
  br i1 %278, label %283, label %279

279:                                              ; preds = %276
  %280 = load ptr, ptr @stderr, align 8, !tbaa !9
  %281 = load i64, ptr getelementptr inbounds (%struct.iovec, ptr @kbuf, i32 0, i32 1), align 8, !tbaa !34
  %282 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %280, ptr noundef @.str.20, i64 noundef %281) #11
  br label %283

283:                                              ; preds = %279, %276
  br label %693

284:                                              ; preds = %269
  %285 = load i64, ptr getelementptr inbounds (%struct.iovec, ptr @kbuf, i32 0, i32 1), align 8, !tbaa !34
  %286 = call noalias ptr @malloc(i64 noundef %285) #14
  store ptr %286, ptr @kbuf, align 8, !tbaa !37
  %287 = load ptr, ptr @kbuf, align 8, !tbaa !37
  %288 = icmp ne ptr %287, null
  br i1 %288, label %291, label %289

289:                                              ; preds = %284
  store i32 12, ptr %7, align 4, !tbaa !5
  %290 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.21, i32 noundef %290)
  br label %693

291:                                              ; preds = %284
  br label %292

292:                                              ; preds = %669, %291
  %293 = load i32, ptr %7, align 4, !tbaa !5
  %294 = icmp eq i32 %293, 0
  br i1 %294, label %295, label %670

295:                                              ; preds = %292
  %296 = load volatile i32, ptr @user_break, align 4, !tbaa !5
  %297 = icmp ne i32 %296, 0
  br i1 %297, label %298, label %299

298:                                              ; preds = %295
  store i32 4, ptr %7, align 4, !tbaa !5
  br label %670

299:                                              ; preds = %295
  %300 = load ptr, ptr %8, align 8, !tbaa !9
  %301 = call i32 @mdbx_txn_begin(ptr noundef %300, ptr noundef null, i32 noundef 0, ptr noundef %9)
  store i32 %301, ptr %7, align 4, !tbaa !5
  %302 = load i32, ptr %7, align 4, !tbaa !5
  %303 = icmp ne i32 %302, 0
  %304 = xor i1 %303, true
  %305 = xor i1 %304, true
  %306 = zext i1 %305 to i32
  %307 = sext i32 %306 to i64
  %308 = call i64 @llvm.expect.i64(i64 %307, i64 0)
  %309 = icmp ne i64 %308, 0
  br i1 %309, label %310, label %312

310:                                              ; preds = %299
  %311 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.22, i32 noundef %311)
  br label %693

312:                                              ; preds = %299
  %313 = load i32, ptr @mode, align 4, !tbaa !5
  %314 = and i32 %313, 4
  %315 = icmp ne i32 %314, 0
  br i1 %315, label %316, label %342

316:                                              ; preds = %312
  %317 = load i32, ptr @mode, align 4, !tbaa !5
  %318 = sub nsw i32 %317, 4
  store i32 %318, ptr @mode, align 4, !tbaa !5
  %319 = load i64, ptr getelementptr inbounds (%struct.MDBX_canary, ptr @canary, i32 0, i32 3), align 8, !tbaa !51
  %320 = load i64, ptr @canary, align 8, !tbaa !53
  %321 = or i64 %319, %320
  %322 = load i64, ptr getelementptr inbounds (%struct.MDBX_canary, ptr @canary, i32 0, i32 1), align 8, !tbaa !54
  %323 = or i64 %321, %322
  %324 = load i64, ptr getelementptr inbounds (%struct.MDBX_canary, ptr @canary, i32 0, i32 2), align 8, !tbaa !55
  %325 = or i64 %323, %324
  %326 = icmp ne i64 %325, 0
  br i1 %326, label %327, label %341

327:                                              ; preds = %316
  %328 = load ptr, ptr %9, align 8, !tbaa !9
  %329 = call i32 @mdbx_canary_put(ptr noundef %328, ptr noundef @canary)
  store i32 %329, ptr %7, align 4, !tbaa !5
  %330 = load i32, ptr %7, align 4, !tbaa !5
  %331 = icmp ne i32 %330, 0
  %332 = xor i1 %331, true
  %333 = xor i1 %332, true
  %334 = zext i1 %333 to i32
  %335 = sext i32 %334 to i64
  %336 = call i64 @llvm.expect.i64(i64 %335, i64 0)
  %337 = icmp ne i64 %336, 0
  br i1 %337, label %338, label %340

338:                                              ; preds = %327
  %339 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.23, i32 noundef %339)
  br label %693

340:                                              ; preds = %327
  br label %341

341:                                              ; preds = %340, %316
  br label %342

342:                                              ; preds = %341, %312
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #11
  %343 = load ptr, ptr @subname, align 8, !tbaa !9
  %344 = icmp ne ptr %343, null
  br i1 %344, label %345, label %347

345:                                              ; preds = %342
  %346 = load ptr, ptr @subname, align 8, !tbaa !9
  br label %348

347:                                              ; preds = %342
  br label %348

348:                                              ; preds = %347, %345
  %349 = phi ptr [ %346, %345 ], [ @.str.24, %347 ]
  store ptr %349, ptr %18, align 8, !tbaa !9
  %350 = load ptr, ptr %9, align 8, !tbaa !9
  %351 = load ptr, ptr @subname, align 8, !tbaa !9
  %352 = load i32, ptr @dbi_flags, align 4, !tbaa !5
  %353 = or i32 %352, 262144
  %354 = load i32, ptr %14, align 4, !tbaa !5
  %355 = and i32 %354, 131072
  %356 = icmp ne i32 %355, 0
  %357 = zext i1 %356 to i64
  %358 = select i1 %356, ptr @equal_or_greater, ptr null
  %359 = load i32, ptr %14, align 4, !tbaa !5
  %360 = and i32 %359, 131072
  %361 = icmp ne i32 %360, 0
  %362 = zext i1 %361 to i64
  %363 = select i1 %361, ptr @equal_or_greater, ptr null
  %364 = call i32 @mdbx_dbi_open_ex(ptr noundef %350, ptr noundef %351, i32 noundef %353, ptr noundef %11, ptr noundef %358, ptr noundef %363)
  store i32 %364, ptr %7, align 4, !tbaa !5
  %365 = load i32, ptr %7, align 4, !tbaa !5
  %366 = icmp ne i32 %365, 0
  %367 = xor i1 %366, true
  %368 = xor i1 %367, true
  %369 = zext i1 %368 to i32
  %370 = sext i32 %369 to i64
  %371 = call i64 @llvm.expect.i64(i64 %370, i64 0)
  %372 = icmp ne i64 %371, 0
  br i1 %372, label %373, label %375

373:                                              ; preds = %348
  %374 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.25, i32 noundef %374)
  store i32 5, ptr %17, align 4
  br label %667

375:                                              ; preds = %348
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #11
  %376 = load ptr, ptr %9, align 8, !tbaa !9
  %377 = load i32, ptr %11, align 4, !tbaa !5
  %378 = call i32 @mdbx_dbi_sequence(ptr noundef %376, i32 noundef %377, ptr noundef %19, i64 noundef 0)
  store i32 %378, ptr %7, align 4, !tbaa !5
  %379 = load i32, ptr %7, align 4, !tbaa !5
  %380 = icmp ne i32 %379, 0
  %381 = xor i1 %380, true
  %382 = xor i1 %381, true
  %383 = zext i1 %382 to i32
  %384 = sext i32 %383 to i64
  %385 = call i64 @llvm.expect.i64(i64 %384, i64 0)
  %386 = icmp ne i64 %385, 0
  br i1 %386, label %387, label %389

387:                                              ; preds = %375
  %388 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.26, i32 noundef %388)
  store i32 5, ptr %17, align 4
  br label %666

389:                                              ; preds = %375
  %390 = load i64, ptr %19, align 8, !tbaa !56
  %391 = load i64, ptr @sequence, align 8, !tbaa !56
  %392 = icmp ugt i64 %390, %391
  br i1 %392, label %393, label %403

393:                                              ; preds = %389
  %394 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %395 = trunc i8 %394 to i1
  br i1 %395, label %402, label %396

396:                                              ; preds = %393
  %397 = load ptr, ptr @stderr, align 8, !tbaa !9
  %398 = load ptr, ptr %18, align 8, !tbaa !9
  %399 = load i64, ptr %19, align 8, !tbaa !56
  %400 = load i64, ptr @sequence, align 8, !tbaa !56
  %401 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %397, ptr noundef @.str.27, ptr noundef %398, i64 noundef %399, i64 noundef %400) #11
  br label %402

402:                                              ; preds = %396, %393
  store i32 -1, ptr %7, align 4, !tbaa !5
  store i32 5, ptr %17, align 4
  br label %666

403:                                              ; preds = %389
  %404 = load i64, ptr %19, align 8, !tbaa !56
  %405 = load i64, ptr @sequence, align 8, !tbaa !56
  %406 = icmp ult i64 %404, %405
  br i1 %406, label %407, label %425

407:                                              ; preds = %403
  %408 = load ptr, ptr %9, align 8, !tbaa !9
  %409 = load i32, ptr %11, align 4, !tbaa !5
  %410 = load i64, ptr @sequence, align 8, !tbaa !56
  %411 = load i64, ptr %19, align 8, !tbaa !56
  %412 = sub i64 %410, %411
  %413 = call i32 @mdbx_dbi_sequence(ptr noundef %408, i32 noundef %409, ptr noundef null, i64 noundef %412)
  store i32 %413, ptr %7, align 4, !tbaa !5
  %414 = load i32, ptr %7, align 4, !tbaa !5
  %415 = icmp ne i32 %414, 0
  %416 = xor i1 %415, true
  %417 = xor i1 %416, true
  %418 = zext i1 %417 to i32
  %419 = sext i32 %418 to i64
  %420 = call i64 @llvm.expect.i64(i64 %419, i64 0)
  %421 = icmp ne i64 %420, 0
  br i1 %421, label %422, label %424

422:                                              ; preds = %407
  %423 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.26, i32 noundef %423)
  store i32 5, ptr %17, align 4
  br label %666

424:                                              ; preds = %407
  br label %425

425:                                              ; preds = %424, %403
  %426 = load i8, ptr %16, align 1, !tbaa !11, !range !30, !noundef !31
  %427 = trunc i8 %426 to i1
  br i1 %427, label %428, label %443

428:                                              ; preds = %425
  %429 = load ptr, ptr %9, align 8, !tbaa !9
  %430 = load i32, ptr %11, align 4, !tbaa !5
  %431 = call i32 @mdbx_drop(ptr noundef %429, i32 noundef %430, i1 noundef zeroext false)
  store i32 %431, ptr %7, align 4, !tbaa !5
  %432 = load i32, ptr %7, align 4, !tbaa !5
  %433 = icmp ne i32 %432, 0
  %434 = xor i1 %433, true
  %435 = xor i1 %434, true
  %436 = zext i1 %435 to i32
  %437 = sext i32 %436 to i64
  %438 = call i64 @llvm.expect.i64(i64 %437, i64 0)
  %439 = icmp ne i64 %438, 0
  br i1 %439, label %440, label %442

440:                                              ; preds = %428
  %441 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.28, i32 noundef %441)
  store i32 5, ptr %17, align 4
  br label %666

442:                                              ; preds = %428
  br label %443

443:                                              ; preds = %442, %425
  %444 = load i32, ptr %14, align 4, !tbaa !5
  %445 = and i32 %444, 131072
  %446 = icmp ne i32 %445, 0
  br i1 %446, label %447, label %459

447:                                              ; preds = %443
  %448 = load i32, ptr @dbi_flags, align 4, !tbaa !5
  %449 = and i32 %448, 4
  %450 = icmp ne i32 %449, 0
  br i1 %450, label %451, label %454

451:                                              ; preds = %447
  %452 = load i32, ptr %14, align 4, !tbaa !5
  %453 = or i32 %452, 262144
  br label %457

454:                                              ; preds = %447
  %455 = load i32, ptr %14, align 4, !tbaa !5
  %456 = and i32 %455, -262145
  br label %457

457:                                              ; preds = %454, %451
  %458 = phi i32 [ %453, %451 ], [ %456, %454 ]
  store i32 %458, ptr %14, align 4, !tbaa !5
  br label %459

459:                                              ; preds = %457, %443
  %460 = load ptr, ptr %9, align 8, !tbaa !9
  %461 = load i32, ptr %11, align 4, !tbaa !5
  %462 = call i32 @mdbx_cursor_open(ptr noundef %460, i32 noundef %461, ptr noundef %10)
  store i32 %462, ptr %7, align 4, !tbaa !5
  %463 = load i32, ptr %7, align 4, !tbaa !5
  %464 = icmp ne i32 %463, 0
  %465 = xor i1 %464, true
  %466 = xor i1 %465, true
  %467 = zext i1 %466 to i32
  %468 = sext i32 %467 to i64
  %469 = call i64 @llvm.expect.i64(i64 %468, i64 0)
  %470 = icmp ne i64 %469, 0
  br i1 %470, label %471, label %473

471:                                              ; preds = %459
  %472 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.29, i32 noundef %472)
  store i32 5, ptr %17, align 4
  br label %666

473:                                              ; preds = %459
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #11
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #11
  call void @llvm.memset.p0.i64(ptr align 8 %21, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #11
  call void @llvm.memset.p0.i64(ptr align 8 %22, i8 0, i64 16, i1 false)
  br label %474

474:                                              ; preds = %604, %525, %508, %473
  %475 = load i32, ptr %7, align 4, !tbaa !5
  %476 = icmp eq i32 %475, 0
  br i1 %476, label %477, label %605

477:                                              ; preds = %474
  %478 = call i32 @readline(ptr noundef %21, ptr noundef @kbuf) #16
  store i32 %478, ptr %7, align 4, !tbaa !5
  %479 = load i32, ptr %7, align 4, !tbaa !5
  %480 = icmp eq i32 %479, -1
  br i1 %480, label %481, label %482

481:                                              ; preds = %477
  br label %605

482:                                              ; preds = %477
  %483 = load i32, ptr %7, align 4, !tbaa !5
  %484 = icmp eq i32 %483, 0
  br i1 %484, label %485, label %487

485:                                              ; preds = %482
  %486 = call i32 @readline(ptr noundef %22, ptr noundef @dbuf) #16
  store i32 %486, ptr %7, align 4, !tbaa !5
  br label %487

487:                                              ; preds = %485, %482
  %488 = load i32, ptr %7, align 4, !tbaa !5
  %489 = icmp ne i32 %488, 0
  br i1 %489, label %490, label %499

490:                                              ; preds = %487
  %491 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %492 = trunc i8 %491 to i1
  br i1 %492, label %498, label %493

493:                                              ; preds = %490
  %494 = load ptr, ptr @stderr, align 8, !tbaa !9
  %495 = load ptr, ptr @prog, align 8, !tbaa !9
  %496 = load i64, ptr @lineno, align 8, !tbaa !56
  %497 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %494, ptr noundef @.str.30, ptr noundef %495, i64 noundef %496) #11
  br label %498

498:                                              ; preds = %493, %490
  store i32 5, ptr %17, align 4
  br label %665

499:                                              ; preds = %487
  %500 = load ptr, ptr %10, align 8, !tbaa !9
  %501 = load i32, ptr %14, align 4, !tbaa !5
  %502 = call i32 @mdbx_cursor_put(ptr noundef %500, ptr noundef %21, ptr noundef %22, i32 noundef %501)
  store i32 %502, ptr %7, align 4, !tbaa !5
  %503 = load i32, ptr %7, align 4, !tbaa !5
  %504 = icmp eq i32 %503, -30799
  br i1 %504, label %505, label %509

505:                                              ; preds = %499
  %506 = load i32, ptr %14, align 4, !tbaa !5
  %507 = icmp ne i32 %506, 0
  br i1 %507, label %508, label %509

508:                                              ; preds = %505
  br label %474, !llvm.loop !57

509:                                              ; preds = %505, %499
  %510 = load i32, ptr %7, align 4, !tbaa !5
  %511 = icmp eq i32 %510, -30781
  br i1 %511, label %512, label %526

512:                                              ; preds = %509
  %513 = load i8, ptr %15, align 1, !tbaa !11, !range !30, !noundef !31
  %514 = trunc i8 %513 to i1
  br i1 %514, label %515, label %526

515:                                              ; preds = %512
  %516 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %517 = trunc i8 %516 to i1
  br i1 %517, label %525, label %518

518:                                              ; preds = %515
  %519 = load ptr, ptr @stderr, align 8, !tbaa !9
  %520 = load ptr, ptr @prog, align 8, !tbaa !9
  %521 = load i64, ptr @lineno, align 8, !tbaa !56
  %522 = load i32, ptr %7, align 4, !tbaa !5
  %523 = call ptr @mdbx_strerror(i32 noundef %522)
  %524 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %519, ptr noundef @.str.31, ptr noundef %520, i64 noundef %521, ptr noundef %523) #11
  br label %525

525:                                              ; preds = %518, %515
  br label %474, !llvm.loop !57

526:                                              ; preds = %512, %509
  %527 = load i32, ptr %7, align 4, !tbaa !5
  %528 = icmp ne i32 %527, 0
  %529 = xor i1 %528, true
  %530 = xor i1 %529, true
  %531 = zext i1 %530 to i32
  %532 = sext i32 %531 to i64
  %533 = call i64 @llvm.expect.i64(i64 %532, i64 0)
  %534 = icmp ne i64 %533, 0
  br i1 %534, label %535, label %537

535:                                              ; preds = %526
  %536 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.32, i32 noundef %536)
  store i32 5, ptr %17, align 4
  br label %665

537:                                              ; preds = %526
  %538 = load i32, ptr %20, align 4, !tbaa !5
  %539 = add nsw i32 %538, 1
  store i32 %539, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %23) #11
  %540 = load ptr, ptr %9, align 8, !tbaa !9
  %541 = call i32 @mdbx_txn_info(ptr noundef %540, ptr noundef %23, i1 noundef zeroext false)
  store i32 %541, ptr %7, align 4, !tbaa !5
  %542 = load i32, ptr %7, align 4, !tbaa !5
  %543 = icmp ne i32 %542, 0
  %544 = xor i1 %543, true
  %545 = xor i1 %544, true
  %546 = zext i1 %545 to i32
  %547 = sext i32 %546 to i64
  %548 = call i64 @llvm.expect.i64(i64 %547, i64 0)
  %549 = icmp ne i64 %548, 0
  br i1 %549, label %550, label %552

550:                                              ; preds = %537
  %551 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.33, i32 noundef %551)
  store i32 5, ptr %17, align 4
  br label %602

552:                                              ; preds = %537
  %553 = load i32, ptr %20, align 4, !tbaa !5
  %554 = icmp eq i32 %553, 10000
  br i1 %554, label %559, label %555

555:                                              ; preds = %552
  %556 = getelementptr inbounds %struct.MDBX_txn_info, ptr %23, i32 0, i32 7
  %557 = load i64, ptr %556, align 8, !tbaa !58
  %558 = icmp ugt i64 %557, 268435456
  br i1 %558, label %559, label %601

559:                                              ; preds = %555, %552
  %560 = load ptr, ptr %9, align 8, !tbaa !9
  %561 = call i32 @mdbx_txn_commit(ptr noundef %560)
  store i32 %561, ptr %7, align 4, !tbaa !5
  %562 = load i32, ptr %7, align 4, !tbaa !5
  %563 = icmp ne i32 %562, 0
  %564 = xor i1 %563, true
  %565 = xor i1 %564, true
  %566 = zext i1 %565 to i32
  %567 = sext i32 %566 to i64
  %568 = call i64 @llvm.expect.i64(i64 %567, i64 0)
  %569 = icmp ne i64 %568, 0
  br i1 %569, label %570, label %572

570:                                              ; preds = %559
  %571 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.34, i32 noundef %571)
  store i32 5, ptr %17, align 4
  br label %602

572:                                              ; preds = %559
  store i32 0, ptr %20, align 4, !tbaa !5
  %573 = load ptr, ptr %8, align 8, !tbaa !9
  %574 = call i32 @mdbx_txn_begin(ptr noundef %573, ptr noundef null, i32 noundef 0, ptr noundef %9)
  store i32 %574, ptr %7, align 4, !tbaa !5
  %575 = load i32, ptr %7, align 4, !tbaa !5
  %576 = icmp ne i32 %575, 0
  %577 = xor i1 %576, true
  %578 = xor i1 %577, true
  %579 = zext i1 %578 to i32
  %580 = sext i32 %579 to i64
  %581 = call i64 @llvm.expect.i64(i64 %580, i64 0)
  %582 = icmp ne i64 %581, 0
  br i1 %582, label %583, label %585

583:                                              ; preds = %572
  %584 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.22, i32 noundef %584)
  store i32 5, ptr %17, align 4
  br label %602

585:                                              ; preds = %572
  %586 = load ptr, ptr %9, align 8, !tbaa !9
  %587 = load ptr, ptr %10, align 8, !tbaa !9
  %588 = load i32, ptr %11, align 4, !tbaa !5
  %589 = call i32 @mdbx_cursor_bind(ptr noundef %586, ptr noundef %587, i32 noundef %588)
  store i32 %589, ptr %7, align 4, !tbaa !5
  %590 = load i32, ptr %7, align 4, !tbaa !5
  %591 = icmp ne i32 %590, 0
  %592 = xor i1 %591, true
  %593 = xor i1 %592, true
  %594 = zext i1 %593 to i32
  %595 = sext i32 %594 to i64
  %596 = call i64 @llvm.expect.i64(i64 %595, i64 0)
  %597 = icmp ne i64 %596, 0
  br i1 %597, label %598, label %600

598:                                              ; preds = %585
  %599 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.35, i32 noundef %599)
  store i32 5, ptr %17, align 4
  br label %602

600:                                              ; preds = %585
  br label %601

601:                                              ; preds = %600, %555
  store i32 0, ptr %17, align 4
  br label %602

602:                                              ; preds = %601, %598, %583, %570, %550
  call void @llvm.lifetime.end.p0(i64 64, ptr %23) #11
  %603 = load i32, ptr %17, align 4
  switch i32 %603, label %665 [
    i32 0, label %604
  ]

604:                                              ; preds = %602
  br label %474, !llvm.loop !57

605:                                              ; preds = %481, %474
  %606 = load ptr, ptr %10, align 8, !tbaa !9
  call void @mdbx_cursor_close(ptr noundef %606)
  store ptr null, ptr %10, align 8, !tbaa !9
  %607 = load ptr, ptr %9, align 8, !tbaa !9
  %608 = call i32 @mdbx_txn_commit(ptr noundef %607)
  store i32 %608, ptr %7, align 4, !tbaa !5
  store ptr null, ptr %9, align 8, !tbaa !9
  %609 = load i32, ptr %7, align 4, !tbaa !5
  %610 = icmp ne i32 %609, 0
  %611 = xor i1 %610, true
  %612 = xor i1 %611, true
  %613 = zext i1 %612 to i32
  %614 = sext i32 %613 to i64
  %615 = call i64 @llvm.expect.i64(i64 %614, i64 0)
  %616 = icmp ne i64 %615, 0
  br i1 %616, label %617, label %619

617:                                              ; preds = %605
  %618 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.34, i32 noundef %618)
  store i32 5, ptr %17, align 4
  br label %665

619:                                              ; preds = %605
  %620 = load ptr, ptr @subname, align 8, !tbaa !9
  %621 = icmp ne ptr %620, null
  br i1 %621, label %622, label %642

622:                                              ; preds = %619
  %623 = load i32, ptr %11, align 4, !tbaa !5
  %624 = icmp ne i32 %623, 1
  br i1 %624, label %625, label %626

625:                                              ; preds = %622
  br label %627

626:                                              ; preds = %622
  call void @__assert_fail(ptr noundef @.str.36, ptr noundef @.str.37, i32 noundef 798, ptr noundef @__PRETTY_FUNCTION__.main) #13
  unreachable

627:                                              ; preds = %625
  %628 = load ptr, ptr %8, align 8, !tbaa !9
  %629 = load i32, ptr %11, align 4, !tbaa !5
  %630 = call i32 @mdbx_dbi_close(ptr noundef %628, i32 noundef %629)
  store i32 %630, ptr %7, align 4, !tbaa !5
  %631 = load i32, ptr %7, align 4, !tbaa !5
  %632 = icmp ne i32 %631, 0
  %633 = xor i1 %632, true
  %634 = xor i1 %633, true
  %635 = zext i1 %634 to i32
  %636 = sext i32 %635 to i64
  %637 = call i64 @llvm.expect.i64(i64 %636, i64 0)
  %638 = icmp ne i64 %637, 0
  br i1 %638, label %639, label %641

639:                                              ; preds = %627
  %640 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.38, i32 noundef %640)
  store i32 5, ptr %17, align 4
  br label %665

641:                                              ; preds = %627
  br label %648

642:                                              ; preds = %619
  %643 = load i32, ptr %11, align 4, !tbaa !5
  %644 = icmp eq i32 %643, 1
  br i1 %644, label %645, label %646

645:                                              ; preds = %642
  br label %647

646:                                              ; preds = %642
  call void @__assert_fail(ptr noundef @.str.39, ptr noundef @.str.37, i32 noundef 805, ptr noundef @__PRETTY_FUNCTION__.main) #13
  unreachable

647:                                              ; preds = %645
  br label %648

648:                                              ; preds = %647, %641
  %649 = load i32, ptr @mode, align 4, !tbaa !5
  %650 = and i32 %649, 2
  %651 = icmp ne i32 %650, 0
  br i1 %651, label %654, label %652

652:                                              ; preds = %648
  %653 = call i32 @readhdr()
  store i32 %653, ptr %7, align 4, !tbaa !5
  br label %664

654:                                              ; preds = %648
  %655 = load ptr, ptr @stdin, align 8, !tbaa !9
  %656 = call i32 @ferror(ptr noundef %655) #11
  %657 = icmp ne i32 %656, 0
  br i1 %657, label %662, label %658

658:                                              ; preds = %654
  %659 = load ptr, ptr @stdin, align 8, !tbaa !9
  %660 = call i32 @feof(ptr noundef %659) #11
  %661 = icmp ne i32 %660, 0
  br i1 %661, label %662, label %663

662:                                              ; preds = %658, %654
  store i32 7, ptr %17, align 4
  br label %665

663:                                              ; preds = %658
  br label %664

664:                                              ; preds = %663, %652
  store i32 0, ptr %17, align 4
  br label %665

665:                                              ; preds = %664, %662, %639, %617, %602, %535, %498
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #11
  br label %666

666:                                              ; preds = %665, %471, %440, %422, %402, %387
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #11
  br label %667

667:                                              ; preds = %666, %373
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #11
  %668 = load i32, ptr %17, align 4
  switch i32 %668, label %717 [
    i32 0, label %669
    i32 7, label %670
    i32 5, label %693
  ]

669:                                              ; preds = %667
  br label %292, !llvm.loop !60

670:                                              ; preds = %667, %298, %292
  %671 = load i32, ptr %7, align 4, !tbaa !5
  switch i32 %671, label %680 [
    i32 -1, label %672
    i32 0, label %692
    i32 4, label %673
  ]

672:                                              ; preds = %670
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %692

673:                                              ; preds = %670
  %674 = load i8, ptr @quiet, align 1, !tbaa !11, !range !30, !noundef !31
  %675 = trunc i8 %674 to i1
  br i1 %675, label %679, label %676

676:                                              ; preds = %673
  %677 = load ptr, ptr @stderr, align 8, !tbaa !9
  %678 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %677, ptr noundef @.str.40) #11
  br label %679

679:                                              ; preds = %676, %673
  br label %692

680:                                              ; preds = %670
  %681 = load i32, ptr %7, align 4, !tbaa !5
  %682 = icmp ne i32 %681, 0
  %683 = xor i1 %682, true
  %684 = xor i1 %683, true
  %685 = zext i1 %684 to i32
  %686 = sext i32 %685 to i64
  %687 = call i64 @llvm.expect.i64(i64 %686, i64 0)
  %688 = icmp ne i64 %687, 0
  br i1 %688, label %689, label %691

689:                                              ; preds = %680
  %690 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.41, i32 noundef %690)
  br label %691

691:                                              ; preds = %689, %680
  br label %692

692:                                              ; preds = %691, %679, %672, %670
  br label %693

693:                                              ; preds = %692, %667, %338, %310, %289, %283, %267, %251, %227, %190, %173, %160, %147, %127
  %694 = load ptr, ptr %10, align 8, !tbaa !9
  %695 = icmp ne ptr %694, null
  br i1 %695, label %696, label %698

696:                                              ; preds = %693
  %697 = load ptr, ptr %10, align 8, !tbaa !9
  call void @mdbx_cursor_close(ptr noundef %697)
  br label %698

698:                                              ; preds = %696, %693
  %699 = load ptr, ptr %9, align 8, !tbaa !9
  %700 = icmp ne ptr %699, null
  br i1 %700, label %701, label %704

701:                                              ; preds = %698
  %702 = load ptr, ptr %9, align 8, !tbaa !9
  %703 = call i32 @mdbx_txn_abort(ptr noundef %702)
  br label %704

704:                                              ; preds = %701, %698
  %705 = load ptr, ptr %8, align 8, !tbaa !9
  %706 = icmp ne ptr %705, null
  br i1 %706, label %707, label %710

707:                                              ; preds = %704
  %708 = load ptr, ptr %8, align 8, !tbaa !9
  %709 = call i32 @mdbx_env_close(ptr noundef %708)
  br label %710

710:                                              ; preds = %707, %704
  %711 = load ptr, ptr @kbuf, align 8, !tbaa !37
  call void @free(ptr noundef %711) #11
  %712 = load ptr, ptr @dbuf, align 8, !tbaa !37
  call void @free(ptr noundef %712) #11
  %713 = load i32, ptr %7, align 4, !tbaa !5
  %714 = icmp ne i32 %713, 0
  %715 = zext i1 %714 to i64
  %716 = select i1 %714, i32 1, i32 0
  store i32 %716, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %717

717:                                              ; preds = %710, %667, %38
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #11
  %718 = load i32, ptr %3, align 4
  ret i32 %718
}

; 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() #0

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

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

declare ptr @freopen64(ptr noundef, ptr noundef, ptr noundef) #3

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

declare ptr @mdbx_strerror(i32 noundef) #3

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #2

; 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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @readhdr() #0

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

declare i32 @mdbx_env_create(ptr noundef) #3

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

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @mdbx_env_get_maxvalsize_ex(ptr noundef, i32 noundef) #8

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

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

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

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

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

declare i32 @mdbx_drop(ptr noundef, i32 noundef, i1 noundef zeroext) #3

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

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

; Function Attrs: hot nounwind uwtable
declare hidden i32 @readline(ptr noundef, ptr noundef) #10

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

declare i32 @mdbx_txn_info(ptr noundef, ptr noundef, i1 noundef zeroext) #3

declare i32 @mdbx_txn_commit(ptr noundef) #3

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

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

declare void @mdbx_cursor_close(ptr noundef) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

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

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

declare i32 @mdbx_txn_abort(ptr noundef) #3

declare i32 @mdbx_env_close(ptr noundef) #3

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

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

!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, !36, i64 8}
!35 = !{!"iovec", !10, i64 0, !36, i64 8}
!36 = !{!"long", !7, i64 0}
!37 = !{!35, !10, i64 0}
!38 = !{!39, !6, i64 128}
!39 = !{!"MDBX_envinfo", !40, i64 0, !36, i64 40, !36, i64 48, !36, i64 56, !36, i64 64, !36, i64 72, !7, i64 80, !7, i64 104, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !41, i64 144, !36, i64 208, !36, i64 216, !6, i64 224, !6, i64 228, !6, i64 232, !6, i64 236, !43, i64 240, !42, i64 336}
!40 = !{!"", !36, i64 0, !36, i64 8, !36, i64 16, !36, i64 24, !36, i64 32}
!41 = !{!"", !42, i64 0, !7, i64 16}
!42 = !{!"", !36, i64 0, !36, i64 8}
!43 = !{!"", !36, i64 0, !36, i64 8, !36, i64 16, !36, i64 24, !36, i64 32, !36, i64 40, !36, i64 48, !36, i64 56, !36, i64 64, !36, i64 72, !36, i64 80, !36, i64 88}
!44 = !{!39, !36, i64 16}
!45 = !{!39, !36, i64 40}
!46 = !{!39, !36, i64 0}
!47 = !{!39, !36, i64 8}
!48 = !{!39, !36, i64 24}
!49 = !{!39, !36, i64 32}
!50 = !{!39, !6, i64 136}
!51 = !{!52, !36, i64 24}
!52 = !{!"MDBX_canary", !36, i64 0, !36, i64 8, !36, i64 16, !36, i64 24}
!53 = !{!52, !36, i64 0}
!54 = !{!52, !36, i64 8}
!55 = !{!52, !36, i64 16}
!56 = !{!36, !36, i64 0}
!57 = distinct !{!57, !33}
!58 = !{!59, !36, i64 56}
!59 = !{!"MDBX_txn_info", !36, i64 0, !36, i64 8, !36, i64 16, !36, i64 24, !36, i64 32, !36, i64 40, !36, i64 48, !36, i64 56}
!60 = distinct !{!60, !33}


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

@prog = external hidden local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = 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
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@quiet = external hidden local_unnamed_addr global i8, align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@subname = external hidden local_unnamed_addr global ptr, align 8
@mode = external hidden local_unnamed_addr global i32, align 4
@optind = external local_unnamed_addr global i32, align 4
@.str.11 = external hidden unnamed_addr constant [43 x i8], align 1
@dbuf = external hidden global %struct.iovec, align 8
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@envinfo = external hidden local_unnamed_addr global %struct.MDBX_envinfo, align 8
@.str.16 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@kbuf = external hidden global %struct.iovec, align 8
@.str.20 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@user_break = external hidden global i32, align 4
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@canary = external hidden global %struct.MDBX_canary, align 8
@.str.23 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [6 x i8], align 1
@dbi_flags = external hidden local_unnamed_addr global i32, align 4
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [18 x i8], align 1
@sequence = external hidden local_unnamed_addr global i64, align 8
@.str.27 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@lineno = external hidden local_unnamed_addr global i64, align 8
@.str.31 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [66 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [23 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [9 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 ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca %struct.iovec, align 8
  %9 = alloca %struct.iovec, align 8
  %10 = alloca %struct.MDBX_txn_info, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #15
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #15
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #15
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #15
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  store ptr %11, ptr @prog, align 8, !tbaa !5
  %12 = icmp slt i32 %0, 2
  br i1 %12, label %13, label %.preheader1325

13:                                               ; preds = %2
  tail call void @usage()
  br label %.preheader1325

.preheader1325:                                   ; preds = %13, %2
  br label %14

14:                                               ; preds = %.backedge, %.preheader1325
  %.098 = phi i32 [ 1073807360, %.preheader1325 ], [ %.098.be, %.backedge ]
  %.094 = phi i32 [ 0, %.preheader1325 ], [ %.094.be, %.backedge ]
  %.092 = phi i1 [ false, %.preheader1325 ], [ %.092.be, %.backedge ]
  %.090 = phi i1 [ false, %.preheader1325 ], [ %.090.be, %.backedge ]
  %15 = tail call i32 @getopt(i32 noundef %0, ptr noundef nonnull %1, ptr noundef nonnull @.str.7) #15
  switch i32 %15, label %67 [
    i32 -1, label %68
    i32 86, label %16
    i32 97, label %36
    i32 102, label %38
    i32 110, label %55
    i32 115, label %57
    i32 78, label %60
    i32 112, label %.backedge
    i32 84, label %62
    i32 113, label %65
    i32 114, label %66
  ]

.backedge:                                        ; preds = %14, %38, %67, %66, %65, %62, %60, %57, %55, %36
  %.098.be = phi i32 [ %.098, %67 ], [ %.098, %66 ], [ %.098, %65 ], [ %.098, %62 ], [ %.098, %60 ], [ %.098, %57 ], [ %56, %55 ], [ %.098, %38 ], [ %.098, %36 ], [ %.098, %14 ]
  %.094.be = phi i32 [ %.094, %67 ], [ %.094, %66 ], [ %.094, %65 ], [ %.094, %62 ], [ %61, %60 ], [ %.094, %57 ], [ %.094, %55 ], [ %.094, %38 ], [ %37, %36 ], [ %.094, %14 ]
  %.092.be = phi i1 [ %.092, %67 ], [ true, %66 ], [ %.092, %65 ], [ %.092, %62 ], [ %.092, %60 ], [ %.092, %57 ], [ %.092, %55 ], [ %.092, %38 ], [ %.092, %36 ], [ %.092, %14 ]
  %.090.be = phi i1 [ %.090, %67 ], [ %.090, %66 ], [ %.090, %65 ], [ %.090, %62 ], [ %.090, %60 ], [ %.090, %57 ], [ %.090, %55 ], [ %.090, %38 ], [ %.090, %36 ], [ true, %14 ]
  br label %14, !llvm.loop !9

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

36:                                               ; preds = %14
  %37 = or i32 %.094, 131072
  br label %.backedge

38:                                               ; preds = %14
  %39 = load ptr, ptr @optarg, align 8, !tbaa !5
  %40 = load ptr, ptr @stdin, align 8, !tbaa !5
  %41 = tail call ptr @freopen64(ptr noundef %39, ptr noundef nonnull @.str.9, ptr noundef %40) #15
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %.backedge

43:                                               ; preds = %38
  %44 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %45 = trunc nuw i8 %44 to i1
  br i1 %45, label %54, label %46

46:                                               ; preds = %43
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = load ptr, ptr @prog, align 8, !tbaa !5
  %49 = load ptr, ptr @optarg, align 8, !tbaa !5
  %50 = tail call ptr @__errno_location() #16
  %51 = load i32, ptr %50, align 4, !tbaa !32
  %52 = tail call ptr @mdbx_strerror(i32 noundef %51) #15
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.10, ptr noundef %48, ptr noundef %49, ptr noundef %52) #17
  br label %54

54:                                               ; preds = %46, %43
  tail call void @exit(i32 noundef 1) #18
  unreachable

55:                                               ; preds = %14
  %56 = or i32 %.098, 16384
  br label %.backedge

57:                                               ; preds = %14
  %58 = load ptr, ptr @optarg, align 8, !tbaa !5
  %59 = tail call noalias ptr @strdup(ptr noundef %58) #15
  store ptr %59, ptr @subname, align 8, !tbaa !5
  br label %.backedge

60:                                               ; preds = %14
  %61 = or i32 %.094, 48
  br label %.backedge

62:                                               ; preds = %14
  %63 = load i32, ptr @mode, align 4, !tbaa !32
  %64 = or i32 %63, 3
  store i32 %64, ptr @mode, align 4, !tbaa !32
  br label %.backedge

65:                                               ; preds = %14
  store i8 1, ptr @quiet, align 1, !tbaa !28
  br label %.backedge

66:                                               ; preds = %14
  br label %.backedge

67:                                               ; preds = %14
  tail call void @usage()
  br label %.backedge

68:                                               ; preds = %14
  %69 = load i32, ptr @optind, align 4, !tbaa !32
  %70 = add nsw i32 %0, -1
  %.not152 = icmp eq i32 %69, %70
  br i1 %.not152, label %72, label %71

71:                                               ; preds = %68
  tail call void @usage()
  br label %72

72:                                               ; preds = %71, %68
  %73 = tail call ptr @signal(i32 noundef 13, ptr noundef nonnull @signal_handler) #15
  %74 = tail call ptr @signal(i32 noundef 1, ptr noundef nonnull @signal_handler) #15
  %75 = tail call ptr @signal(i32 noundef 2, ptr noundef nonnull @signal_handler) #15
  %76 = tail call ptr @signal(i32 noundef 15, ptr noundef nonnull @signal_handler) #15
  %77 = load i32, ptr @optind, align 4, !tbaa !32
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %1, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %82 = trunc nuw i8 %81 to i1
  br i1 %82, label %90, label %83

83:                                               ; preds = %72
  %84 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 40), align 8, !tbaa !18
  %85 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 16), align 8, !tbaa !19
  %86 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 24), align 8, !tbaa !21
  %87 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %84, ptr noundef %85, ptr noundef %86, ptr noundef %80)
  %88 = tail call i32 @fflush(ptr noundef null)
  %89 = tail call i32 @mdbx_setup_debug(i32 noundef 3, i32 noundef -1, ptr noundef nonnull @logger) #15
  br label %90

90:                                               ; preds = %83, %72
  store i64 4096, ptr getelementptr inbounds (i8, ptr @dbuf, i64 8), align 8, !tbaa !34
  %91 = tail call noalias dereferenceable_or_null(4096) ptr @malloc(i64 noundef 4096) #19
  store ptr %91, ptr @dbuf, align 8, !tbaa !37
  %.not153 = icmp eq ptr %91, null
  br i1 %.not153, label %92, label %93

92:                                               ; preds = %90
  tail call void @error(ptr noundef nonnull @.str.12, i32 noundef 12)
  br label %.loopexit

93:                                               ; preds = %90
  %94 = load i32, ptr @mode, align 4, !tbaa !32
  %95 = and i32 %94, 2
  %.not154 = icmp eq i32 %95, 0
  br i1 %.not154, label %96, label %100

96:                                               ; preds = %93
  %97 = tail call i32 @readhdr()
  %.not155 = icmp eq i32 %97, 0
  br i1 %.not155, label %100, label %98, !prof !38

98:                                               ; preds = %96
  %99 = icmp eq i32 %97, -1
  %spec.store.select = select i1 %99, i32 61, i32 %97
  tail call void @error(ptr noundef nonnull @.str.13, i32 noundef %spec.store.select)
  br label %.loopexit

100:                                              ; preds = %96, %93
  %101 = call i32 @mdbx_env_create(ptr noundef nonnull %3) #15
  %.not156 = icmp eq i32 %101, 0
  br i1 %.not156, label %103, label %102, !prof !38

102:                                              ; preds = %100
  call void @error(ptr noundef nonnull @.str.14, i32 noundef %101)
  br label %.loopexit

103:                                              ; preds = %100
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = call i32 @mdbx_env_set_maxdbs(ptr noundef %104, i32 noundef 2) #15
  %.not157 = icmp eq i32 %105, 0
  br i1 %.not157, label %107, label %106, !prof !38

106:                                              ; preds = %103
  call void @error(ptr noundef nonnull @.str.15, i32 noundef %105)
  br label %.loopexit

107:                                              ; preds = %103
  %108 = load i32, ptr getelementptr inbounds (i8, ptr @envinfo, i64 128), align 8, !tbaa !39
  %.not158 = icmp eq i32 %108, 0
  br i1 %.not158, label %113, label %109

109:                                              ; preds = %107
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = call i32 @mdbx_env_set_maxreaders(ptr noundef %110, i32 noundef %108) #15
  %.not159 = icmp eq i32 %111, 0
  br i1 %.not159, label %113, label %112, !prof !38

112:                                              ; preds = %109
  call void @error(ptr noundef nonnull @.str.16, i32 noundef %111)
  br label %.loopexit

113:                                              ; preds = %109, %107
  %114 = load i64, ptr getelementptr inbounds (i8, ptr @envinfo, i64 16), align 8, !tbaa !45
  %115 = load i64, ptr getelementptr inbounds (i8, ptr @envinfo, i64 40), align 8, !tbaa !46
  %116 = or i64 %115, %114
  %.not160 = icmp eq i64 %116, 0
  br i1 %.not160, label %144, label %117

117:                                              ; preds = %113
  %.not161 = icmp eq i64 %114, 0
  br i1 %.not161, label %128, label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = load i64, ptr @envinfo, align 8, !tbaa !47
  %121 = load i64, ptr getelementptr inbounds (i8, ptr @envinfo, i64 8), align 8, !tbaa !48
  %122 = load i64, ptr getelementptr inbounds (i8, ptr @envinfo, i64 24), align 8, !tbaa !49
  %123 = load i64, ptr getelementptr inbounds (i8, ptr @envinfo, i64 32), align 8, !tbaa !50
  %124 = load i32, ptr getelementptr inbounds (i8, ptr @envinfo, i64 136), align 8
  %.not163 = icmp eq i32 %124, 0
  %125 = zext i32 %124 to i64
  %126 = select i1 %.not163, i64 -1, i64 %125
  %127 = call i32 @mdbx_env_set_geometry(ptr noundef %119, i64 noundef %120, i64 noundef %114, i64 noundef %121, i64 noundef %122, i64 noundef %123, i64 noundef %126) #15
  br label %142

128:                                              ; preds = %117
  %129 = icmp ugt i64 %115, 140737488355328
  br i1 %129, label %130, label %136

130:                                              ; preds = %128
  %131 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %132 = trunc nuw i8 %131 to i1
  br i1 %132, label %.loopexit, label %133

133:                                              ; preds = %130
  %134 = load ptr, ptr @stderr, align 8, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef nonnull @.str.17, i64 noundef %115, i64 noundef 140737488355328) #17
  br label %.loopexit

136:                                              ; preds = %128
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = load i32, ptr getelementptr inbounds (i8, ptr @envinfo, i64 136), align 8
  %.not162 = icmp eq i32 %138, 0
  %139 = zext i32 %138 to i64
  %140 = select i1 %.not162, i64 -1, i64 %139
  %141 = call i32 @mdbx_env_set_geometry(ptr noundef %137, i64 noundef %115, i64 noundef %115, i64 noundef %115, i64 noundef 0, i64 noundef 0, i64 noundef %140) #15
  br label %142

142:                                              ; preds = %136, %118
  %.1101 = phi i32 [ %127, %118 ], [ %141, %136 ]
  %.not164 = icmp eq i32 %.1101, 0
  br i1 %.not164, label %144, label %143, !prof !38

143:                                              ; preds = %142
  call void @error(ptr noundef nonnull @.str.18, i32 noundef %.1101)
  br label %.loopexit

144:                                              ; preds = %142, %113
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = call i32 @mdbx_env_open(ptr noundef %145, ptr noundef %80, i32 noundef %.098, i32 noundef 436) #15
  %.not165 = icmp eq i32 %146, 0
  br i1 %.not165, label %148, label %147, !prof !38

147:                                              ; preds = %144
  call void @error(ptr noundef nonnull @.str.19, i32 noundef %146)
  br label %.loopexit

148:                                              ; preds = %144
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = call i32 @mdbx_env_get_maxvalsize_ex(ptr noundef %149, i32 noundef 0) #20
  %151 = sext i32 %150 to i64
  %152 = add nsw i64 %151, 1
  store i64 %152, ptr getelementptr inbounds (i8, ptr @kbuf, i64 8), align 8, !tbaa !34
  %153 = icmp ugt i64 %152, 4611686018427387902
  br i1 %153, label %154, label %160

154:                                              ; preds = %148
  %155 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %156 = trunc nuw i8 %155 to i1
  br i1 %156, label %.loopexit, label %157

157:                                              ; preds = %154
  %158 = load ptr, ptr @stderr, align 8, !tbaa !5
  %159 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef nonnull @.str.20, i64 noundef %152) #17
  br label %.loopexit

160:                                              ; preds = %148
  %161 = call noalias ptr @malloc(i64 noundef %152) #19
  store ptr %161, ptr @kbuf, align 8, !tbaa !37
  %.not166 = icmp eq ptr %161, null
  br i1 %.not166, label %163, label %.preheader

.preheader:                                       ; preds = %160
  %162 = getelementptr inbounds i8, ptr %10, i64 56
  br label %164

163:                                              ; preds = %160
  call void @error(ptr noundef nonnull @.str.21, i32 noundef 12)
  br label %.loopexit

164:                                              ; preds = %.preheader, %select.unfold
  %.2102 = phi i32 [ %.9, %select.unfold ], [ 0, %.preheader ]
  %.296 = phi i32 [ %.397.fr, %select.unfold ], [ %.094, %.preheader ]
  switch i32 %.2102, label %343 [
    i32 0, label %165
    i32 -1, label %.loopexit
    i32 4, label %.thread225
  ]

165:                                              ; preds = %164
  %166 = load volatile i32, ptr @user_break, align 4, !tbaa !32
  %.not167 = icmp eq i32 %166, 0
  br i1 %.not167, label %167, label %.thread225

167:                                              ; preds = %165
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = call i32 @mdbx_txn_begin(ptr noundef %168, ptr noundef null, i32 noundef 0, ptr noundef nonnull %4) #15
  %.not168 = icmp eq i32 %169, 0
  br i1 %.not168, label %171, label %170, !prof !38

170:                                              ; preds = %167
  call void @error(ptr noundef nonnull @.str.22, i32 noundef %169)
  br label %.loopexit

171:                                              ; preds = %167
  %172 = load i32, ptr @mode, align 4, !tbaa !32
  %173 = and i32 %172, 4
  %.not169 = icmp eq i32 %173, 0
  br i1 %.not169, label %182, label %174

174:                                              ; preds = %171
  %175 = add nsw i32 %172, -4
  store i32 %175, ptr @mode, align 4, !tbaa !32
  %176 = load <4 x i64>, ptr @canary, align 8, !tbaa !51
  %177 = call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> %176)
  %.not170 = icmp eq i64 %177, 0
  br i1 %.not170, label %182, label %178

178:                                              ; preds = %174
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = call i32 @mdbx_canary_put(ptr noundef %179, ptr noundef nonnull @canary) #15
  %.not171 = icmp eq i32 %180, 0
  br i1 %.not171, label %182, label %181, !prof !38

181:                                              ; preds = %178
  call void @error(ptr noundef nonnull @.str.23, i32 noundef %180)
  br label %.loopexit

182:                                              ; preds = %174, %178, %171
  %183 = load ptr, ptr @subname, align 8
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  %185 = load i32, ptr @dbi_flags, align 4, !tbaa !32
  %186 = or i32 %185, 262144
  %187 = and i32 %.296, 131072
  %.not173 = icmp eq i32 %187, 0
  %188 = select i1 %.not173, ptr null, ptr @equal_or_greater
  %189 = call i32 @mdbx_dbi_open_ex(ptr noundef %184, ptr noundef %183, i32 noundef %186, ptr noundef nonnull %6, ptr noundef %188, ptr noundef %188) #15
  %.not174 = icmp eq i32 %189, 0
  br i1 %.not174, label %190, label %.thread206, !prof !38

.thread206:                                       ; preds = %182
  call void @error(ptr noundef nonnull @.str.25, i32 noundef %189)
  br label %.loopexit

190:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #15
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = load i32, ptr %6, align 4, !tbaa !32
  %193 = call i32 @mdbx_dbi_sequence(ptr noundef %191, i32 noundef %192, ptr noundef nonnull %7, i64 noundef 0) #15
  %.not175 = icmp eq i32 %193, 0
  br i1 %.not175, label %195, label %194, !prof !38

194:                                              ; preds = %190
  call void @error(ptr noundef nonnull @.str.26, i32 noundef %193)
  br label %.thread211

195:                                              ; preds = %190
  %196 = load i64, ptr %7, align 8, !tbaa !51
  %197 = load i64, ptr @sequence, align 8, !tbaa !51
  %198 = icmp ugt i64 %196, %197
  br i1 %198, label %199, label %206

199:                                              ; preds = %195
  %200 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %201 = trunc nuw i8 %200 to i1
  br i1 %201, label %.thread211, label %202

202:                                              ; preds = %199
  %.not172.le = icmp eq ptr %183, null
  %203 = select i1 %.not172.le, ptr @.str.24, ptr %183
  %204 = load ptr, ptr @stderr, align 8, !tbaa !5
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef nonnull @.str.27, ptr noundef nonnull %203, i64 noundef %196, i64 noundef %197) #17
  br label %.thread211

206:                                              ; preds = %195
  %207 = icmp ult i64 %196, %197
  br i1 %207, label %208, label %214

208:                                              ; preds = %206
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = load i32, ptr %6, align 4, !tbaa !32
  %211 = sub i64 %197, %196
  %212 = call i32 @mdbx_dbi_sequence(ptr noundef %209, i32 noundef %210, ptr noundef null, i64 noundef %211) #15
  %.not176 = icmp eq i32 %212, 0
  br i1 %.not176, label %214, label %213, !prof !38

213:                                              ; preds = %208
  call void @error(ptr noundef nonnull @.str.26, i32 noundef %212)
  br label %.thread211

214:                                              ; preds = %208, %206
  br i1 %.090, label %215, label %220

215:                                              ; preds = %214
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = load i32, ptr %6, align 4, !tbaa !32
  %218 = call i32 @mdbx_drop(ptr noundef %216, i32 noundef %217, i1 noundef zeroext false) #15
  %.not177 = icmp eq i32 %218, 0
  br i1 %.not177, label %220, label %219, !prof !38

219:                                              ; preds = %215
  call void @error(ptr noundef nonnull @.str.28, i32 noundef %218)
  br label %.thread211

220:                                              ; preds = %215, %214
  br i1 %.not173, label %226, label %221

221:                                              ; preds = %220
  %222 = load i32, ptr @dbi_flags, align 4, !tbaa !32
  %223 = and i32 %.296, -262145
  %224 = shl i32 %222, 16
  %masksel = and i32 %224, 262144
  %225 = or disjoint i32 %masksel, %223
  br label %226

226:                                              ; preds = %221, %220
  %.397 = phi i32 [ %225, %221 ], [ %.296, %220 ]
  %.397.fr = freeze i32 %.397
  %227 = load ptr, ptr %4, align 8, !tbaa !5
  %228 = load i32, ptr %6, align 4, !tbaa !32
  %229 = call i32 @mdbx_cursor_open(ptr noundef %227, i32 noundef %228, ptr noundef nonnull %5) #15
  %.not179 = icmp eq i32 %229, 0
  br i1 %.not179, label %231, label %230, !prof !38

230:                                              ; preds = %226
  call void @error(ptr noundef nonnull @.str.29, i32 noundef %229)
  br label %.thread211

231:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %9, i8 0, i64 16, i1 false)
  %.not = icmp eq i32 %.397.fr, 0
  br i1 %.092, label %.outer.us, label %.outer

.outer.us:                                        ; preds = %231, %249
  %.0.ph.us = phi i32 [ %.2.us, %249 ], [ 0, %231 ]
  %232 = call i32 @readline(ptr noundef nonnull %8, ptr noundef nonnull @kbuf) #21
  br i1 %.not, label %.outer.split.us.us.split.us, label %.outer.split.us.us.split

233:                                              ; preds = %.split391.us.us
  %234 = add nsw i32 %.0.ph.us, 1
  %235 = icmp eq i32 %234, 10000
  %236 = load i64, ptr %162, align 8
  %237 = icmp ugt i64 %236, 268435456
  %or.cond4.us = select i1 %235, i1 true, i1 %237
  br i1 %or.cond4.us, label %238, label %249

238:                                              ; preds = %233
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = call i32 @mdbx_txn_commit(ptr noundef %239) #15
  %.not183.us = icmp eq i32 %240, 0
  br i1 %.not183.us, label %241, label %.split403.us, !prof !38

241:                                              ; preds = %238
  %242 = load ptr, ptr %3, align 8, !tbaa !5
  %243 = call i32 @mdbx_txn_begin(ptr noundef %242, ptr noundef null, i32 noundef 0, ptr noundef nonnull %4) #15
  %.not184.us = icmp eq i32 %243, 0
  br i1 %.not184.us, label %244, label %.split406.us, !prof !38

244:                                              ; preds = %241
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = load i32, ptr %6, align 4, !tbaa !32
  %248 = call i32 @mdbx_cursor_bind(ptr noundef %245, ptr noundef %246, i32 noundef %247) #15
  %.not185.us = icmp eq i32 %248, 0
  br i1 %.not185.us, label %249, label %.split409.us, !prof !38

249:                                              ; preds = %244, %233
  %.2.us = phi i32 [ 0, %244 ], [ %234, %233 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #15
  br label %.outer.us, !llvm.loop !52

.outer.split.us.us.split.us:                      ; preds = %.outer.us
  switch i32 %232, label %.thread [
    i32 -1, label %.split.us.split.us
    i32 0, label %250
  ]

250:                                              ; preds = %.outer.split.us.us.split.us
  %251 = call i32 @readline(ptr noundef nonnull %9, ptr noundef nonnull @dbuf) #21
  %.not180.us.us.us = icmp eq i32 %251, 0
  br i1 %.not180.us.us.us, label %252, label %.thread

252:                                              ; preds = %250
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = call i32 @mdbx_cursor_put(ptr noundef %253, ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef 0) #15
  switch i32 %254, label %.split388.us [
    i32 -30781, label %255
    i32 0, label %.split391.us.us
  ], !prof !53

255:                                              ; preds = %252
  %256 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %257 = trunc nuw i8 %256 to i1
  br i1 %257, label %.split.us.split.us, label %258, !llvm.loop !52

258:                                              ; preds = %255
  br label %.split.us.split.us.sink.split, !llvm.loop !52

.outer.split.us.us.split:                         ; preds = %.outer.us
  switch i32 %232, label %.thread [
    i32 -1, label %.split.us.split.us
    i32 0, label %259
  ]

259:                                              ; preds = %.outer.split.us.us.split
  %260 = call i32 @readline(ptr noundef nonnull %9, ptr noundef nonnull @dbuf) #21
  %.not180.us.us = icmp eq i32 %260, 0
  br i1 %.not180.us.us, label %261, label %.thread

261:                                              ; preds = %259
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = call i32 @mdbx_cursor_put(ptr noundef %262, ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef %.397.fr) #15
  switch i32 %263, label %.split388.us [
    i32 -30799, label %.split.us.split.us
    i32 -30781, label %264
    i32 0, label %.split391.us.us
  ], !prof !54, !llvm.loop !52

264:                                              ; preds = %261
  %265 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %266 = trunc nuw i8 %265 to i1
  br i1 %266, label %.split.us.split.us, label %267, !llvm.loop !52

267:                                              ; preds = %264
  br label %.split.us.split.us.sink.split, !llvm.loop !52

.split391.us.us:                                  ; preds = %261, %252
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #15
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = call i32 @mdbx_txn_info(ptr noundef %268, ptr noundef nonnull %10, i1 noundef zeroext false) #15
  %.not182.us = icmp eq i32 %269, 0
  br i1 %.not182.us, label %233, label %.split412.us, !prof !38

.outer:                                           ; preds = %231, %306
  %.0.ph = phi i32 [ %.2, %306 ], [ 0, %231 ]
  %270 = call i32 @readline(ptr noundef nonnull %8, ptr noundef nonnull @kbuf) #21
  br i1 %.not, label %.outer.split.split.us, label %.outer.split.split

.outer.split.split.us:                            ; preds = %.outer
  switch i32 %270, label %.thread [
    i32 -1, label %.split.us.split.us
    i32 0, label %271
  ]

271:                                              ; preds = %.outer.split.split.us
  %272 = call i32 @readline(ptr noundef nonnull %9, ptr noundef nonnull @dbuf) #21
  %.not180.us394 = icmp eq i32 %272, 0
  br i1 %.not180.us394, label %.split399.us, label %.thread

.split399.us:                                     ; preds = %271
  %273 = load ptr, ptr %5, align 8, !tbaa !5
  %274 = call i32 @mdbx_cursor_put(ptr noundef %273, ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef 0) #15
  br label %.split399

.outer.split.split:                               ; preds = %.outer
  switch i32 %270, label %.thread [
    i32 -1, label %.split.us.split.us
    i32 0, label %275
  ]

275:                                              ; preds = %.outer.split.split
  %276 = call i32 @readline(ptr noundef nonnull %9, ptr noundef nonnull @dbuf) #21
  %.not180 = icmp eq i32 %276, 0
  br i1 %.not180, label %284, label %.thread

.thread:                                          ; preds = %271, %.outer.split.split.us, %.outer.split.split, %275, %.outer.split.us.us.split, %259, %.outer.split.us.us.split.us, %250
  %277 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %278 = trunc nuw i8 %277 to i1
  br i1 %278, label %.thread216, label %279

279:                                              ; preds = %.thread
  %280 = load ptr, ptr @stderr, align 8, !tbaa !5
  %281 = load ptr, ptr @prog, align 8, !tbaa !5
  %282 = load i64, ptr @lineno, align 8, !tbaa !51
  %283 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %280, ptr noundef nonnull @.str.30, ptr noundef %281, i64 noundef %282) #17
  br label %.thread216

284:                                              ; preds = %275
  %285 = load ptr, ptr %5, align 8, !tbaa !5
  %286 = call i32 @mdbx_cursor_put(ptr noundef %285, ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef %.397.fr) #15
  %287 = icmp eq i32 %286, -30799
  br i1 %287, label %.split.us.split.us, label %.split399, !llvm.loop !52

.split399:                                        ; preds = %284, %.split399.us
  %.us-phi400 = phi i32 [ %274, %.split399.us ], [ %286, %284 ]
  %cond = icmp eq i32 %.us-phi400, 0
  br i1 %cond, label %.split391, label %.split388.us, !prof !55

.split388.us:                                     ; preds = %.split399, %261, %252
  %.us-phi389 = phi i32 [ %254, %252 ], [ %263, %261 ], [ %.us-phi400, %.split399 ]
  call void @error(ptr noundef nonnull @.str.32, i32 noundef %.us-phi389)
  br label %.thread216

.split391:                                        ; preds = %.split399
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #15
  %288 = load ptr, ptr %4, align 8, !tbaa !5
  %289 = call i32 @mdbx_txn_info(ptr noundef %288, ptr noundef nonnull %10, i1 noundef zeroext false) #15
  %.not182 = icmp eq i32 %289, 0
  br i1 %.not182, label %290, label %.split412.us, !prof !38

.split412.us:                                     ; preds = %.split391, %.split391.us.us
  %.us-phi413 = phi i32 [ %269, %.split391.us.us ], [ %289, %.split391 ]
  call void @error(ptr noundef nonnull @.str.33, i32 noundef %.us-phi413)
  br label %.thread201

290:                                              ; preds = %.split391
  %291 = add nsw i32 %.0.ph, 1
  %292 = icmp eq i32 %291, 10000
  %293 = load i64, ptr %162, align 8
  %294 = icmp ugt i64 %293, 268435456
  %or.cond4 = select i1 %292, i1 true, i1 %294
  br i1 %or.cond4, label %295, label %306

295:                                              ; preds = %290
  %296 = load ptr, ptr %4, align 8, !tbaa !5
  %297 = call i32 @mdbx_txn_commit(ptr noundef %296) #15
  %.not183 = icmp eq i32 %297, 0
  br i1 %.not183, label %298, label %.split403.us, !prof !38

.split403.us:                                     ; preds = %295, %238
  %.us-phi404 = phi i32 [ %240, %238 ], [ %297, %295 ]
  call void @error(ptr noundef nonnull @.str.34, i32 noundef %.us-phi404)
  br label %.thread201

298:                                              ; preds = %295
  %299 = load ptr, ptr %3, align 8, !tbaa !5
  %300 = call i32 @mdbx_txn_begin(ptr noundef %299, ptr noundef null, i32 noundef 0, ptr noundef nonnull %4) #15
  %.not184 = icmp eq i32 %300, 0
  br i1 %.not184, label %301, label %.split406.us, !prof !38

.split406.us:                                     ; preds = %298, %241
  %.us-phi407 = phi i32 [ %243, %241 ], [ %300, %298 ]
  call void @error(ptr noundef nonnull @.str.22, i32 noundef %.us-phi407)
  br label %.thread201

301:                                              ; preds = %298
  %302 = load ptr, ptr %4, align 8, !tbaa !5
  %303 = load ptr, ptr %5, align 8, !tbaa !5
  %304 = load i32, ptr %6, align 4, !tbaa !32
  %305 = call i32 @mdbx_cursor_bind(ptr noundef %302, ptr noundef %303, i32 noundef %304) #15
  %.not185 = icmp eq i32 %305, 0
  br i1 %.not185, label %306, label %.split409.us, !prof !38

.split409.us:                                     ; preds = %301, %244
  %.us-phi410 = phi i32 [ %248, %244 ], [ %305, %301 ]
  call void @error(ptr noundef nonnull @.str.35, i32 noundef %.us-phi410)
  br label %.thread201

.thread201:                                       ; preds = %.split412.us, %.split403.us, %.split406.us, %.split409.us
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #15
  br label %.thread216

306:                                              ; preds = %290, %301
  %.2 = phi i32 [ 0, %301 ], [ %291, %290 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #15
  br label %.outer, !llvm.loop !52

.split.us.split.us.sink.split:                    ; preds = %267, %258
  %307 = load ptr, ptr @stderr, align 8, !tbaa !5
  %308 = load ptr, ptr @prog, align 8, !tbaa !5
  %309 = load i64, ptr @lineno, align 8, !tbaa !51
  %310 = call ptr @mdbx_strerror(i32 noundef -30781) #15
  %311 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %307, ptr noundef nonnull @.str.31, ptr noundef %308, i64 noundef %309, ptr noundef %310) #17
  br label %.split.us.split.us

.split.us.split.us:                               ; preds = %.outer.split.split.us, %284, %.outer.split.split, %.outer.split.us.us.split.us, %261, %.outer.split.us.us.split, %.split.us.split.us.sink.split, %255, %264
  %312 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mdbx_cursor_close(ptr noundef %312) #15
  store ptr null, ptr %5, align 8, !tbaa !5
  %313 = load ptr, ptr %4, align 8, !tbaa !5
  %314 = call i32 @mdbx_txn_commit(ptr noundef %313) #15
  store ptr null, ptr %4, align 8, !tbaa !5
  %.not186 = icmp eq i32 %314, 0
  br i1 %.not186, label %316, label %315, !prof !38

315:                                              ; preds = %.split.us.split.us
  call void @error(ptr noundef nonnull @.str.34, i32 noundef %314)
  br label %.thread216

316:                                              ; preds = %.split.us.split.us
  %317 = load ptr, ptr @subname, align 8, !tbaa !5
  %.not187 = icmp eq ptr %317, null
  %318 = load i32, ptr %6, align 4, !tbaa !32
  %319 = icmp eq i32 %318, 1
  br i1 %.not187, label %326, label %320

320:                                              ; preds = %316
  br i1 %319, label %321, label %322

321:                                              ; preds = %320
  call void @__assert_fail(ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.37, i32 noundef 798, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #18
  unreachable

322:                                              ; preds = %320
  %323 = load ptr, ptr %3, align 8, !tbaa !5
  %324 = call i32 @mdbx_dbi_close(ptr noundef %323, i32 noundef %318) #15
  %.not189 = icmp eq i32 %324, 0
  br i1 %.not189, label %328, label %325, !prof !38

325:                                              ; preds = %322
  call void @error(ptr noundef nonnull @.str.38, i32 noundef %324)
  br label %.thread216

326:                                              ; preds = %316
  br i1 %319, label %328, label %327

327:                                              ; preds = %326
  call void @__assert_fail(ptr noundef nonnull @.str.39, ptr noundef nonnull @.str.37, i32 noundef 805, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #18
  unreachable

328:                                              ; preds = %326, %322
  %329 = load i32, ptr @mode, align 4, !tbaa !32
  %330 = and i32 %329, 2
  %.not190 = icmp eq i32 %330, 0
  br i1 %.not190, label %331, label %333

331:                                              ; preds = %328
  %332 = call i32 @readhdr()
  br label %select.unfold

333:                                              ; preds = %328
  %334 = load ptr, ptr @stdin, align 8, !tbaa !5
  %335 = call i32 @ferror(ptr noundef %334) #15
  %.not191 = icmp eq i32 %335, 0
  br i1 %.not191, label %336, label %.thread223

336:                                              ; preds = %333
  %337 = call i32 @feof(ptr noundef %334) #15
  %.not192 = icmp eq i32 %337, 0
  br i1 %.not192, label %select.unfold, label %.thread223

.thread211:                                       ; preds = %194, %213, %219, %230, %202, %199
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #15
  br label %.loopexit

.thread216:                                       ; preds = %315, %325, %.split388.us, %279, %.thread, %.thread201
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #15
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #15
  br label %.loopexit

.thread223:                                       ; preds = %336, %333
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #15
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #15
  br label %.loopexit

select.unfold:                                    ; preds = %336, %331
  %.9 = phi i32 [ %332, %331 ], [ 0, %336 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #15
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #15
  br label %164

.thread225:                                       ; preds = %164, %165
  %338 = load i8, ptr @quiet, align 1, !tbaa !28, !range !30, !noundef !31
  %339 = trunc nuw i8 %338 to i1
  br i1 %339, label %.loopexit, label %340

340:                                              ; preds = %.thread225
  %341 = load ptr, ptr @stderr, align 8, !tbaa !5
  %342 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %341, ptr noundef nonnull @.str.40) #17
  br label %.loopexit

343:                                              ; preds = %164
  call void @error(ptr noundef nonnull @.str.41, i32 noundef %.2102)
  br label %.loopexit

.loopexit:                                        ; preds = %164, %.thread223, %.thread216, %.thread211, %.thread206, %340, %.thread225, %343, %154, %157, %130, %133, %181, %170, %163, %147, %143, %112, %106, %102, %98, %92
  %.13 = phi i32 [ 1, %102 ], [ 1, %106 ], [ 1, %112 ], [ 1, %143 ], [ 1, %147 ], [ 0, %154 ], [ 0, %157 ], [ 1, %343 ], [ 1, %.thread225 ], [ 1, %340 ], [ 1, %170 ], [ 1, %181 ], [ 1, %163 ], [ 0, %130 ], [ 0, %133 ], [ 1, %98 ], [ 1, %92 ], [ 1, %.thread206 ], [ 1, %.thread211 ], [ 1, %.thread216 ], [ 0, %.thread223 ], [ 0, %164 ]
  %344 = load ptr, ptr %5, align 8, !tbaa !5
  %.not194 = icmp eq ptr %344, null
  br i1 %.not194, label %346, label %345

345:                                              ; preds = %.loopexit
  call void @mdbx_cursor_close(ptr noundef nonnull %344) #15
  br label %346

346:                                              ; preds = %345, %.loopexit
  %347 = load ptr, ptr %4, align 8, !tbaa !5
  %.not195 = icmp eq ptr %347, null
  br i1 %.not195, label %350, label %348

348:                                              ; preds = %346
  %349 = call i32 @mdbx_txn_abort(ptr noundef nonnull %347) #15
  br label %350

350:                                              ; preds = %348, %346
  %351 = load ptr, ptr %3, align 8, !tbaa !5
  %.not196 = icmp eq ptr %351, null
  br i1 %.not196, label %354, label %352

352:                                              ; preds = %350
  %353 = call i32 @mdbx_env_close(ptr noundef nonnull %351) #15
  br label %354

354:                                              ; preds = %352, %350
  %355 = load ptr, ptr @kbuf, align 8, !tbaa !37
  call void @free(ptr noundef %355) #15
  %356 = load ptr, ptr @dbuf, align 8, !tbaa !37
  call void @free(ptr noundef %356) #15
  br label %357

357:                                              ; preds = %354, %16
  %.086 = phi i32 [ 0, %16 ], [ %.13, %354 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #15
  ret i32 %.086
}

; 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() 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

declare ptr @freopen64(ptr noundef, ptr noundef, 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 ptr @mdbx_strerror(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #7

; 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

; 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: nounwind uwtable
declare hidden void @error(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @readhdr() local_unnamed_addr #0

declare i32 @mdbx_env_create(ptr noundef) local_unnamed_addr #4

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @mdbx_env_get_maxvalsize_ex(ptr noundef, i32 noundef) local_unnamed_addr #9

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

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

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

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

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

declare i32 @mdbx_drop(ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #4

declare i32 @mdbx_cursor_open(ptr noundef, i32 noundef, ptr 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) #10

; Function Attrs: hot nounwind uwtable
declare hidden i32 @readline(ptr noundef, ptr noundef) local_unnamed_addr #11

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

declare i32 @mdbx_txn_info(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #4

declare i32 @mdbx_txn_commit(ptr noundef) local_unnamed_addr #4

declare i32 @mdbx_cursor_bind(ptr noundef, ptr noundef, i32 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 void @mdbx_cursor_close(ptr noundef) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

; Function Attrs: nofree nounwind memory(read)
declare noundef i32 @ferror(ptr nocapture noundef) local_unnamed_addr #12

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

declare i32 @mdbx_txn_abort(ptr noundef) local_unnamed_addr #4

declare i32 @mdbx_env_close(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.or.v4i64(<4 x i64>) #14

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 nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn 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 #7 = { mustprogress nofree nounwind willreturn 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 #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 nofree 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 #10 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #11 = { hot nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { nofree nounwind 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 #13 = { 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 #14 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #15 = { nounwind }
attributes #16 = { nounwind willreturn memory(none) }
attributes #17 = { cold nounwind }
attributes #18 = { noreturn nounwind }
attributes #19 = { nounwind allocsize(0) }
attributes #20 = { nounwind willreturn memory(read) }
attributes #21 = { hot }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !13, i64 0}
!12 = !{!"MDBX_version_info", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !6, i64 8, !14, i64 16, !6, i64 48}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!12, !13, i64 2}
!16 = !{!12, !13, i64 4}
!17 = !{!12, !13, i64 6}
!18 = !{!12, !6, i64 40}
!19 = !{!12, !6, i64 16}
!20 = !{!12, !6, i64 32}
!21 = !{!12, !6, i64 24}
!22 = !{!23, !6, i64 0}
!23 = !{!"MDBX_build_info", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!24 = !{!23, !6, i64 8}
!25 = !{!23, !6, i64 24}
!26 = !{!23, !6, i64 32}
!27 = !{!23, !6, i64 16}
!28 = !{!29, !29, i64 0}
!29 = !{!"_Bool", !7, i64 0}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!33, !33, i64 0}
!33 = !{!"int", !7, i64 0}
!34 = !{!35, !36, i64 8}
!35 = !{!"iovec", !6, i64 0, !36, i64 8}
!36 = !{!"long", !7, i64 0}
!37 = !{!35, !6, i64 0}
!38 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!39 = !{!40, !33, i64 128}
!40 = !{!"MDBX_envinfo", !41, i64 0, !36, i64 40, !36, i64 48, !36, i64 56, !36, i64 64, !36, i64 72, !7, i64 80, !7, i64 104, !33, i64 128, !33, i64 132, !33, i64 136, !33, i64 140, !42, i64 144, !36, i64 208, !36, i64 216, !33, i64 224, !33, i64 228, !33, i64 232, !33, i64 236, !44, i64 240, !43, i64 336}
!41 = !{!"", !36, i64 0, !36, i64 8, !36, i64 16, !36, i64 24, !36, i64 32}
!42 = !{!"", !43, i64 0, !7, i64 16}
!43 = !{!"", !36, i64 0, !36, i64 8}
!44 = !{!"", !36, i64 0, !36, i64 8, !36, i64 16, !36, i64 24, !36, i64 32, !36, i64 40, !36, i64 48, !36, i64 56, !36, i64 64, !36, i64 72, !36, i64 80, !36, i64 88}
!45 = !{!40, !36, i64 16}
!46 = !{!40, !36, i64 40}
!47 = !{!40, !36, i64 0}
!48 = !{!40, !36, i64 8}
!49 = !{!40, !36, i64 24}
!50 = !{!40, !36, i64 32}
!51 = !{!36, !36, i64 0}
!52 = distinct !{!52, !10}
!53 = !{!"branch_weights", i32 1, i32 2001, i32 2000}
!54 = !{!"branch_weights", i32 1, i32 4002, i32 2001, i32 2000}
!55 = !{!"branch_weights", i32 2000, i32 2002}


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