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

; 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 }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [136 x i8], align 1
@mdbx_version = external constant %struct.MDBX_version_info, align 8
@mdbx_sourcery_MDBX_BUILD_SOURCERY = external constant ptr, align 8
@mdbx_build = external constant %struct.MDBX_build_info, align 8
@stderr = external global ptr, align 8
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 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 ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = getelementptr inbounds ptr, ptr %17, i64 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  store ptr %19, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 131072, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  store i8 0, ptr %12, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i8 0, ptr %13, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %230, %2
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 1
  br i1 %22, label %23, label %31

23:                                               ; preds = %20
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 1
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 0
  %28 = load i8, ptr %27, align 1, !tbaa !13
  %29 = sext i8 %28 to i32
  %30 = icmp eq i32 %29, 45
  br label %31

31:                                               ; preds = %23, %20
  %32 = phi i1 [ false, %20 ], [ %30, %23 ]
  br i1 %32, label %33, label %235

33:                                               ; preds = %31
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = getelementptr inbounds ptr, ptr %34, i64 1
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %36, i64 1
  %38 = load i8, ptr %37, align 1, !tbaa !13
  %39 = sext i8 %38 to i32
  %40 = icmp eq i32 %39, 110
  br i1 %40, label %41, label %52

41:                                               ; preds = %33
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds ptr, ptr %42, i64 1
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds i8, ptr %44, i64 2
  %46 = load i8, ptr %45, align 1, !tbaa !13
  %47 = sext i8 %46 to i32
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %41
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = or i32 %50, 16384
  store i32 %51, ptr %10, align 4, !tbaa !5
  br label %229

52:                                               ; preds = %41, %33
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  %54 = getelementptr inbounds ptr, ptr %53, i64 1
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %55, i64 1
  %57 = load i8, ptr %56, align 1, !tbaa !13
  %58 = sext i8 %57 to i32
  %59 = icmp eq i32 %58, 99
  br i1 %59, label %60, label %71

60:                                               ; preds = %52
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = getelementptr inbounds ptr, ptr %61, i64 1
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds i8, ptr %63, i64 2
  %65 = load i8, ptr %64, align 1, !tbaa !13
  %66 = sext i8 %65 to i32
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %71

68:                                               ; preds = %60
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %70 = or i32 %69, 1
  store i32 %70, ptr %11, align 4, !tbaa !5
  br label %228

71:                                               ; preds = %60, %52
  %72 = load ptr, ptr %5, align 8, !tbaa !9
  %73 = getelementptr inbounds ptr, ptr %72, i64 1
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = getelementptr inbounds i8, ptr %74, i64 1
  %76 = load i8, ptr %75, align 1, !tbaa !13
  %77 = sext i8 %76 to i32
  %78 = icmp eq i32 %77, 100
  br i1 %78, label %79, label %90

79:                                               ; preds = %71
  %80 = load ptr, ptr %5, align 8, !tbaa !9
  %81 = getelementptr inbounds ptr, ptr %80, i64 1
  %82 = load ptr, ptr %81, align 8, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %82, i64 2
  %84 = load i8, ptr %83, align 1, !tbaa !13
  %85 = sext i8 %84 to i32
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %87, label %90

87:                                               ; preds = %79
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = or i32 %88, 2
  store i32 %89, ptr %11, align 4, !tbaa !5
  br label %227

90:                                               ; preds = %79, %71
  %91 = load ptr, ptr %5, align 8, !tbaa !9
  %92 = getelementptr inbounds ptr, ptr %91, i64 1
  %93 = load ptr, ptr %92, align 8, !tbaa !9
  %94 = getelementptr inbounds i8, ptr %93, i64 1
  %95 = load i8, ptr %94, align 1, !tbaa !13
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %96, 112
  br i1 %97, label %98, label %109

98:                                               ; preds = %90
  %99 = load ptr, ptr %5, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %99, i64 1
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  %102 = getelementptr inbounds i8, ptr %101, i64 2
  %103 = load i8, ptr %102, align 1, !tbaa !13
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %109

106:                                              ; preds = %98
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = or i32 %107, 8
  store i32 %108, ptr %11, align 4, !tbaa !5
  br label %226

109:                                              ; preds = %98, %90
  %110 = load ptr, ptr %5, align 8, !tbaa !9
  %111 = getelementptr inbounds ptr, ptr %110, i64 1
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %112, i64 1
  %114 = load i8, ptr %113, align 1, !tbaa !13
  %115 = sext i8 %114 to i32
  %116 = icmp eq i32 %115, 113
  br i1 %116, label %117, label %126

117:                                              ; preds = %109
  %118 = load ptr, ptr %5, align 8, !tbaa !9
  %119 = getelementptr inbounds ptr, ptr %118, i64 1
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  %121 = getelementptr inbounds i8, ptr %120, i64 2
  %122 = load i8, ptr %121, align 1, !tbaa !13
  %123 = sext i8 %122 to i32
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %117
  store i8 1, ptr %12, align 1, !tbaa !11
  br label %225

126:                                              ; preds = %117, %109
  %127 = load ptr, ptr %5, align 8, !tbaa !9
  %128 = getelementptr inbounds ptr, ptr %127, i64 1
  %129 = load ptr, ptr %128, align 8, !tbaa !9
  %130 = getelementptr inbounds i8, ptr %129, i64 1
  %131 = load i8, ptr %130, align 1, !tbaa !13
  %132 = sext i8 %131 to i32
  %133 = icmp eq i32 %132, 117
  br i1 %133, label %134, label %143

134:                                              ; preds = %126
  %135 = load ptr, ptr %5, align 8, !tbaa !9
  %136 = getelementptr inbounds ptr, ptr %135, i64 1
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = getelementptr inbounds i8, ptr %137, i64 2
  %139 = load i8, ptr %138, align 1, !tbaa !13
  %140 = sext i8 %139 to i32
  %141 = icmp eq i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %134
  store i8 1, ptr %13, align 1, !tbaa !11
  br label %224

143:                                              ; preds = %134, %126
  %144 = load ptr, ptr %5, align 8, !tbaa !9
  %145 = getelementptr inbounds ptr, ptr %144, i64 1
  %146 = load ptr, ptr %145, align 8, !tbaa !9
  %147 = getelementptr inbounds i8, ptr %146, i64 1
  %148 = load i8, ptr %147, align 1, !tbaa !13
  %149 = sext i8 %148 to i32
  %150 = icmp eq i32 %149, 85
  br i1 %150, label %151, label %160

151:                                              ; preds = %143
  %152 = load ptr, ptr %5, align 8, !tbaa !9
  %153 = getelementptr inbounds ptr, ptr %152, i64 1
  %154 = load ptr, ptr %153, align 8, !tbaa !9
  %155 = getelementptr inbounds i8, ptr %154, i64 2
  %156 = load i8, ptr %155, align 1, !tbaa !13
  %157 = sext i8 %156 to i32
  %158 = icmp eq i32 %157, 0
  br i1 %158, label %159, label %160

159:                                              ; preds = %151
  store i8 1, ptr %13, align 1, !tbaa !11
  store i32 13, ptr %14, align 4, !tbaa !5
  br label %223

160:                                              ; preds = %151, %143
  %161 = load ptr, ptr %5, align 8, !tbaa !9
  %162 = getelementptr inbounds ptr, ptr %161, i64 1
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = getelementptr inbounds i8, ptr %163, i64 1
  %165 = load i8, ptr %164, align 1, !tbaa !13
  %166 = sext i8 %165 to i32
  %167 = icmp eq i32 %166, 104
  br i1 %167, label %168, label %176

168:                                              ; preds = %160
  %169 = load ptr, ptr %5, align 8, !tbaa !9
  %170 = getelementptr inbounds ptr, ptr %169, i64 1
  %171 = load ptr, ptr %170, align 8, !tbaa !9
  %172 = getelementptr inbounds i8, ptr %171, i64 2
  %173 = load i8, ptr %172, align 1, !tbaa !13
  %174 = sext i8 %173 to i32
  %175 = icmp eq i32 %174, 0
  br i1 %175, label %182, label %176

176:                                              ; preds = %168, %160
  %177 = load ptr, ptr %5, align 8, !tbaa !9
  %178 = getelementptr inbounds ptr, ptr %177, i64 1
  %179 = load ptr, ptr %178, align 8, !tbaa !9
  %180 = call i32 @strcmp(ptr noundef %179, ptr noundef @.str) #6
  %181 = icmp eq i32 %180, 0
  br i1 %181, label %182, label %184

182:                                              ; preds = %176, %168
  %183 = load ptr, ptr %8, align 8, !tbaa !9
  call void @usage(ptr noundef %183)
  br label %222

184:                                              ; preds = %176
  %185 = load ptr, ptr %5, align 8, !tbaa !9
  %186 = getelementptr inbounds ptr, ptr %185, i64 1
  %187 = load ptr, ptr %186, align 8, !tbaa !9
  %188 = getelementptr inbounds i8, ptr %187, i64 1
  %189 = load i8, ptr %188, align 1, !tbaa !13
  %190 = sext i8 %189 to i32
  %191 = icmp eq i32 %190, 86
  br i1 %191, label %192, label %220

192:                                              ; preds = %184
  %193 = load ptr, ptr %5, align 8, !tbaa !9
  %194 = getelementptr inbounds ptr, ptr %193, i64 1
  %195 = load ptr, ptr %194, align 8, !tbaa !9
  %196 = getelementptr inbounds i8, ptr %195, i64 2
  %197 = load i8, ptr %196, align 1, !tbaa !13
  %198 = sext i8 %197 to i32
  %199 = icmp eq i32 %198, 0
  br i1 %199, label %200, label %220

200:                                              ; preds = %192
  %201 = load i16, ptr @mdbx_version, align 8, !tbaa !14
  %202 = zext i16 %201 to i32
  %203 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 1), align 2, !tbaa !18
  %204 = zext i16 %203 to i32
  %205 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 2), align 4, !tbaa !19
  %206 = zext i16 %205 to i32
  %207 = load i16, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 3), align 2, !tbaa !20
  %208 = zext i16 %207 to i32
  %209 = 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 !21
  %210 = load ptr, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), align 8, !tbaa !22
  %211 = 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 !23
  %212 = 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 !24
  %213 = load ptr, ptr @mdbx_sourcery_MDBX_BUILD_SOURCERY, align 8, !tbaa !9
  %214 = load ptr, ptr @mdbx_build, align 8, !tbaa !25
  %215 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 1), align 8, !tbaa !27
  %216 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 3), align 8, !tbaa !28
  %217 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 4), align 8, !tbaa !29
  %218 = load ptr, ptr getelementptr inbounds (%struct.MDBX_build_info, ptr @mdbx_build, i32 0, i32 2), align 8, !tbaa !30
  %219 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %202, i32 noundef %204, i32 noundef %206, i32 noundef %208, ptr noundef %209, ptr noundef %210, ptr noundef %211, ptr noundef %212, ptr noundef %213, ptr noundef %214, ptr noundef %215, ptr noundef %216, ptr noundef %217, ptr noundef %218)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %340

220:                                              ; preds = %192, %184
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221, %182
  br label %223

223:                                              ; preds = %222, %159
  br label %224

224:                                              ; preds = %223, %142
  br label %225

225:                                              ; preds = %224, %125
  br label %226

226:                                              ; preds = %225, %106
  br label %227

227:                                              ; preds = %226, %87
  br label %228

228:                                              ; preds = %227, %68
  br label %229

229:                                              ; preds = %228, %49
  br label %230

230:                                              ; preds = %229
  %231 = load i32, ptr %4, align 4, !tbaa !5
  %232 = add nsw i32 %231, -1
  store i32 %232, ptr %4, align 4, !tbaa !5
  %233 = load ptr, ptr %5, align 8, !tbaa !9
  %234 = getelementptr inbounds ptr, ptr %233, i32 1
  store ptr %234, ptr %5, align 8, !tbaa !9
  br label %20, !llvm.loop !31

235:                                              ; preds = %31
  %236 = load i32, ptr %4, align 4, !tbaa !5
  %237 = icmp slt i32 %236, 2
  br i1 %237, label %241, label %238

238:                                              ; preds = %235
  %239 = load i32, ptr %4, align 4, !tbaa !5
  %240 = icmp sgt i32 %239, 3
  br i1 %240, label %241, label %243

241:                                              ; preds = %238, %235
  %242 = load ptr, ptr %8, align 8, !tbaa !9
  call void @usage(ptr noundef %242)
  br label %243

243:                                              ; preds = %241, %238
  %244 = call ptr @signal(i32 noundef 13, ptr noundef @signal_handler) #5
  %245 = call ptr @signal(i32 noundef 1, ptr noundef @signal_handler) #5
  %246 = call ptr @signal(i32 noundef 2, ptr noundef @signal_handler) #5
  %247 = call ptr @signal(i32 noundef 15, ptr noundef @signal_handler) #5
  %248 = load i8, ptr %12, align 1, !tbaa !11, !range !33, !noundef !34
  %249 = trunc i8 %248 to i1
  br i1 %249, label %277, label %250

250:                                              ; preds = %243
  %251 = load i32, ptr %4, align 4, !tbaa !5
  %252 = icmp eq i32 %251, 2
  br i1 %252, label %253, label %255

253:                                              ; preds = %250
  %254 = load ptr, ptr @stderr, align 8, !tbaa !9
  br label %257

255:                                              ; preds = %250
  %256 = load ptr, ptr @stdout, align 8, !tbaa !9
  br label %257

257:                                              ; preds = %255, %253
  %258 = phi ptr [ %254, %253 ], [ %256, %255 ]
  %259 = 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 !21
  %260 = load ptr, ptr getelementptr inbounds (%struct.MDBX_version_info, ptr @mdbx_version, i32 0, i32 5), align 8, !tbaa !22
  %261 = 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 !24
  %262 = load ptr, ptr %5, align 8, !tbaa !9
  %263 = getelementptr inbounds ptr, ptr %262, i64 1
  %264 = load ptr, ptr %263, align 8, !tbaa !9
  %265 = load i32, ptr %4, align 4, !tbaa !5
  %266 = icmp eq i32 %265, 2
  br i1 %266, label %267, label %268

267:                                              ; preds = %257
  br label %272

268:                                              ; preds = %257
  %269 = load ptr, ptr %5, align 8, !tbaa !9
  %270 = getelementptr inbounds ptr, ptr %269, i64 2
  %271 = load ptr, ptr %270, align 8, !tbaa !9
  br label %272

272:                                              ; preds = %268, %267
  %273 = phi ptr [ @.str.3, %267 ], [ %271, %268 ]
  %274 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %258, ptr noundef @.str.2, ptr noundef %259, ptr noundef %260, ptr noundef %261, ptr noundef %264, ptr noundef %273) #5
  %275 = call i32 @fflush(ptr noundef null)
  %276 = call i32 @mdbx_setup_debug(i32 noundef 3, i32 noundef -1, ptr noundef @logger)
  br label %277

277:                                              ; preds = %272, %243
  store ptr @.str.4, ptr %9, align 8, !tbaa !9
  %278 = call i32 @mdbx_env_create(ptr noundef %7)
  store i32 %278, ptr %6, align 4, !tbaa !5
  %279 = load i32, ptr %6, align 4, !tbaa !5
  %280 = icmp eq i32 %279, 0
  br i1 %280, label %281, label %288

281:                                              ; preds = %277
  %282 = load ptr, ptr %7, align 8, !tbaa !9
  %283 = load ptr, ptr %5, align 8, !tbaa !9
  %284 = getelementptr inbounds ptr, ptr %283, i64 1
  %285 = load ptr, ptr %284, align 8, !tbaa !9
  %286 = load i32, ptr %10, align 4, !tbaa !5
  %287 = call i32 @mdbx_env_open(ptr noundef %282, ptr noundef %285, i32 noundef %286, i32 noundef 0)
  store i32 %287, ptr %6, align 4, !tbaa !5
  br label %288

288:                                              ; preds = %281, %277
  %289 = load i32, ptr %6, align 4, !tbaa !5
  %290 = icmp eq i32 %289, 0
  br i1 %290, label %291, label %298

291:                                              ; preds = %288
  %292 = load i8, ptr %13, align 1, !tbaa !11, !range !33, !noundef !34
  %293 = trunc i8 %292 to i1
  br i1 %293, label %294, label %298

294:                                              ; preds = %291
  store ptr @.str.5, ptr %9, align 8, !tbaa !9
  %295 = load ptr, ptr %7, align 8, !tbaa !9
  %296 = load i32, ptr %14, align 4, !tbaa !5
  %297 = call i32 @mdbx_env_warmup(ptr noundef %295, ptr noundef null, i32 noundef %296, i32 noundef 235929600)
  store i32 %297, ptr %6, align 4, !tbaa !5
  br label %298

298:                                              ; preds = %294, %291, %288
  %299 = load i32, ptr %6, align 4, !tbaa !5
  %300 = icmp ne i32 %299, -1
  br i1 %300, label %301, label %304

301:                                              ; preds = %298
  %302 = load i32, ptr %6, align 4, !tbaa !5
  %303 = icmp ne i32 %302, 0
  br i1 %303, label %322, label %304

304:                                              ; preds = %301, %298
  store ptr @.str.6, ptr %9, align 8, !tbaa !9
  %305 = load i32, ptr %4, align 4, !tbaa !5
  %306 = icmp eq i32 %305, 2
  br i1 %306, label %307, label %314

307:                                              ; preds = %304
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %308 = load ptr, ptr @stdout, align 8, !tbaa !9
  %309 = call i32 @fileno(ptr noundef %308) #5
  store i32 %309, ptr %16, align 4, !tbaa !5
  %310 = load ptr, ptr %7, align 8, !tbaa !9
  %311 = load i32, ptr %16, align 4, !tbaa !5
  %312 = load i32, ptr %11, align 4, !tbaa !5
  %313 = call i32 @mdbx_env_copy2fd(ptr noundef %310, i32 noundef %311, i32 noundef %312)
  store i32 %313, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %321

314:                                              ; preds = %304
  %315 = load ptr, ptr %7, align 8, !tbaa !9
  %316 = load ptr, ptr %5, align 8, !tbaa !9
  %317 = getelementptr inbounds ptr, ptr %316, i64 2
  %318 = load ptr, ptr %317, align 8, !tbaa !9
  %319 = load i32, ptr %11, align 4, !tbaa !5
  %320 = call i32 @mdbx_env_copy(ptr noundef %315, ptr noundef %318, i32 noundef %319)
  store i32 %320, ptr %6, align 4, !tbaa !5
  br label %321

321:                                              ; preds = %314, %307
  br label %322

322:                                              ; preds = %321, %301
  %323 = load i32, ptr %6, align 4, !tbaa !5
  %324 = icmp ne i32 %323, 0
  br i1 %324, label %325, label %333

325:                                              ; preds = %322
  %326 = load ptr, ptr @stderr, align 8, !tbaa !9
  %327 = load ptr, ptr %8, align 8, !tbaa !9
  %328 = load ptr, ptr %9, align 8, !tbaa !9
  %329 = load i32, ptr %6, align 4, !tbaa !5
  %330 = load i32, ptr %6, align 4, !tbaa !5
  %331 = call ptr @mdbx_strerror(i32 noundef %330)
  %332 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %326, ptr noundef @.str.7, ptr noundef %327, ptr noundef %328, i32 noundef %329, ptr noundef %331) #5
  br label %333

333:                                              ; preds = %325, %322
  %334 = load ptr, ptr %7, align 8, !tbaa !9
  %335 = call i32 @mdbx_env_close(ptr noundef %334)
  %336 = load i32, ptr %6, align 4, !tbaa !5
  %337 = icmp ne i32 %336, 0
  %338 = zext i1 %337 to i64
  %339 = select i1 %337, i32 1, i32 0
  store i32 %339, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %340

340:                                              ; preds = %333, %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %341 = load i32, ptr %3, align 4
  ret i32 %341
}

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

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

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

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

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

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

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

declare i32 @fflush(ptr noundef) #3

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

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

declare i32 @mdbx_env_create(ptr noundef) #3

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

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

; Function Attrs: nounwind
declare i32 @fileno(ptr noundef) #4

declare i32 @mdbx_env_copy2fd(ptr noundef, i32 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 i32 @mdbx_env_copy(ptr noundef, ptr noundef, i32 noundef) #3

declare ptr @mdbx_strerror(i32 noundef) #3

declare i32 @mdbx_env_close(ptr noundef) #3

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

!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 = !{!7, !7, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"MDBX_version_info", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !10, i64 8, !17, i64 16, !10, i64 48}
!16 = !{!"short", !7, i64 0}
!17 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!18 = !{!15, !16, i64 2}
!19 = !{!15, !16, i64 4}
!20 = !{!15, !16, i64 6}
!21 = !{!15, !10, i64 40}
!22 = !{!15, !10, i64 16}
!23 = !{!15, !10, i64 32}
!24 = !{!15, !10, i64 24}
!25 = !{!26, !10, i64 0}
!26 = !{!"MDBX_build_info", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!27 = !{!26, !10, i64 8}
!28 = !{!26, !10, i64 24}
!29 = !{!26, !10, i64 32}
!30 = !{!26, !10, i64 16}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{i8 0, i8 2}
!34 = !{}


; 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 }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [136 x i8], align 1
@mdbx_version = external local_unnamed_addr constant %struct.MDBX_version_info, align 8
@mdbx_sourcery_MDBX_BUILD_SOURCERY = external local_unnamed_addr constant ptr, align 8
@mdbx_build = external local_unnamed_addr constant %struct.MDBX_build_info, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store ptr null, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  %5 = icmp sgt i32 %0, 1
  br i1 %5, label %.lr.ph, label %.critedge.thread

.lr.ph:                                           ; preds = %2, %82
  %.059136 = phi i32 [ %.1, %82 ], [ 0, %2 ]
  %.060135 = phi i1 [ %.161, %82 ], [ false, %2 ]
  %.062134 = phi i1 [ %.163, %82 ], [ false, %2 ]
  %.064133 = phi i32 [ %.165, %82 ], [ 0, %2 ]
  %.066132 = phi i32 [ %.167, %82 ], [ 131072, %2 ]
  %.070130 = phi i32 [ %83, %82 ], [ %0, %2 ]
  %.074129 = phi ptr [ %6, %82 ], [ %1, %2 ]
  %6 = getelementptr inbounds i8, ptr %.074129, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load i8, ptr %7, align 1, !tbaa !9
  %9 = icmp eq i8 %8, 45
  br i1 %9, label %10, label %.critedge

10:                                               ; preds = %.lr.ph
  %11 = getelementptr inbounds i8, ptr %7, i64 1
  %12 = load i8, ptr %11, align 1, !tbaa !9
  switch i8 %12, label %.thread85 [
    i8 110, label %13
    i8 99, label %19
    i8 100, label %25
    i8 112, label %31
    i8 113, label %37
    i8 117, label %41
    i8 85, label %45
    i8 104, label %49
  ]

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %7, i64 2
  %15 = load i8, ptr %14, align 1, !tbaa !9
  %16 = icmp eq i8 %15, 0
  br i1 %16, label %17, label %.thread85

17:                                               ; preds = %13
  %18 = or i32 %.066132, 16384
  br label %82

19:                                               ; preds = %10
  %20 = getelementptr inbounds i8, ptr %7, i64 2
  %21 = load i8, ptr %20, align 1, !tbaa !9
  %22 = icmp eq i8 %21, 0
  br i1 %22, label %23, label %.thread85

23:                                               ; preds = %19
  %24 = or i32 %.064133, 1
  br label %82

25:                                               ; preds = %10
  %26 = getelementptr inbounds i8, ptr %7, i64 2
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = icmp eq i8 %27, 0
  br i1 %28, label %29, label %.thread85

29:                                               ; preds = %25
  %30 = or i32 %.064133, 2
  br label %82

31:                                               ; preds = %10
  %32 = getelementptr inbounds i8, ptr %7, i64 2
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %34 = icmp eq i8 %33, 0
  br i1 %34, label %35, label %.thread85

35:                                               ; preds = %31
  %36 = or i32 %.064133, 8
  br label %82

37:                                               ; preds = %10
  %38 = getelementptr inbounds i8, ptr %7, i64 2
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = icmp eq i8 %39, 0
  br i1 %40, label %82, label %.thread85

41:                                               ; preds = %10
  %42 = getelementptr inbounds i8, ptr %7, i64 2
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = icmp eq i8 %43, 0
  br i1 %44, label %82, label %.thread85

45:                                               ; preds = %10
  %46 = getelementptr inbounds i8, ptr %7, i64 2
  %47 = load i8, ptr %46, align 1, !tbaa !9
  %48 = icmp eq i8 %47, 0
  br i1 %48, label %82, label %.thread85

49:                                               ; preds = %10
  %50 = getelementptr inbounds i8, ptr %7, i64 2
  %51 = load i8, ptr %50, align 1, !tbaa !9
  %52 = icmp eq i8 %51, 0
  br i1 %52, label %55, label %.thread85

.thread85:                                        ; preds = %10, %41, %37, %31, %25, %19, %13, %45, %49
  %53 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str) #7
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %.thread85, %49
  tail call void @usage(ptr noundef %4)
  br label %82

56:                                               ; preds = %.thread85
  %57 = icmp eq i8 %12, 86
  br i1 %57, label %58, label %.critedge.thread

58:                                               ; preds = %56
  %59 = getelementptr inbounds i8, ptr %7, i64 2
  %60 = load i8, ptr %59, align 1, !tbaa !9
  %61 = icmp eq i8 %60, 0
  br i1 %61, label %62, label %.critedge.thread

62:                                               ; preds = %58
  %63 = load i16, ptr @mdbx_version, align 8, !tbaa !10
  %64 = zext i16 %63 to i32
  %65 = load i16, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 2), align 2, !tbaa !14
  %66 = zext i16 %65 to i32
  %67 = load i16, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 4), align 4, !tbaa !15
  %68 = zext i16 %67 to i32
  %69 = load i16, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 6), align 2, !tbaa !16
  %70 = zext i16 %69 to i32
  %71 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 40), align 8, !tbaa !17
  %72 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 16), align 8, !tbaa !18
  %73 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 32), align 8, !tbaa !19
  %74 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 24), align 8, !tbaa !20
  %75 = load ptr, ptr @mdbx_sourcery_MDBX_BUILD_SOURCERY, align 8, !tbaa !5
  %76 = load ptr, ptr @mdbx_build, align 8, !tbaa !21
  %77 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_build, i64 8), align 8, !tbaa !23
  %78 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_build, i64 24), align 8, !tbaa !24
  %79 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_build, i64 32), align 8, !tbaa !25
  %80 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_build, i64 16), align 8, !tbaa !26
  %81 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %64, i32 noundef %66, i32 noundef %68, i32 noundef %70, ptr noundef %71, ptr noundef %72, ptr noundef %73, ptr noundef %74, ptr noundef %75, ptr noundef %76, ptr noundef %77, ptr noundef %78, ptr noundef %79, ptr noundef %80)
  br label %141

82:                                               ; preds = %45, %41, %37, %17, %29, %55, %35, %23
  %.167 = phi i32 [ %18, %17 ], [ %.066132, %23 ], [ %.066132, %29 ], [ %.066132, %35 ], [ %.066132, %55 ], [ %.066132, %37 ], [ %.066132, %41 ], [ %.066132, %45 ]
  %.165 = phi i32 [ %.064133, %17 ], [ %24, %23 ], [ %30, %29 ], [ %36, %35 ], [ %.064133, %55 ], [ %.064133, %37 ], [ %.064133, %41 ], [ %.064133, %45 ]
  %.163 = phi i1 [ %.062134, %17 ], [ %.062134, %23 ], [ %.062134, %29 ], [ %.062134, %35 ], [ %.062134, %55 ], [ true, %37 ], [ %.062134, %41 ], [ %.062134, %45 ]
  %.161 = phi i1 [ %.060135, %17 ], [ %.060135, %23 ], [ %.060135, %29 ], [ %.060135, %35 ], [ %.060135, %55 ], [ %.060135, %37 ], [ true, %41 ], [ true, %45 ]
  %.1 = phi i32 [ %.059136, %17 ], [ %.059136, %23 ], [ %.059136, %29 ], [ %.059136, %35 ], [ %.059136, %55 ], [ %.059136, %37 ], [ %.059136, %41 ], [ 13, %45 ]
  %83 = add nsw i32 %.070130, -1
  %84 = icmp ugt i32 %.070130, 2
  br i1 %84, label %.lr.ph, label %.critedge.thread, !llvm.loop !27

.critedge:                                        ; preds = %.lr.ph
  %85 = add nsw i32 %.070130, -4
  %or.cond = icmp ult i32 %85, -2
  br i1 %or.cond, label %.critedge.thread, label %86

.critedge.thread:                                 ; preds = %82, %56, %58, %2, %.critedge
  %.074128 = phi ptr [ %.074129, %.critedge ], [ %1, %2 ], [ %6, %58 ], [ %6, %56 ], [ %6, %82 ]
  %.070124 = phi i32 [ %.070130, %.critedge ], [ %0, %2 ], [ -1, %58 ], [ -1, %56 ], [ %83, %82 ]
  %.066120 = phi i32 [ %.066132, %.critedge ], [ 131072, %2 ], [ %.066132, %58 ], [ %.066132, %56 ], [ %.167, %82 ]
  %.064116 = phi i32 [ %.064133, %.critedge ], [ 0, %2 ], [ %.064133, %58 ], [ %.064133, %56 ], [ %.165, %82 ]
  %.062112 = phi i1 [ %.062134, %.critedge ], [ false, %2 ], [ %.062134, %58 ], [ %.062134, %56 ], [ %.163, %82 ]
  %.060108 = phi i1 [ %.060135, %.critedge ], [ false, %2 ], [ %.060135, %58 ], [ %.060135, %56 ], [ %.161, %82 ]
  %.059104 = phi i32 [ %.059136, %.critedge ], [ 0, %2 ], [ %.059136, %58 ], [ %.059136, %56 ], [ %.1, %82 ]
  tail call void @usage(ptr noundef %4)
  br label %86

86:                                               ; preds = %.critedge, %.critedge.thread
  %.074127 = phi ptr [ %.074129, %.critedge ], [ %.074128, %.critedge.thread ]
  %.070123 = phi i32 [ %.070130, %.critedge ], [ %.070124, %.critedge.thread ]
  %.066119 = phi i32 [ %.066132, %.critedge ], [ %.066120, %.critedge.thread ]
  %.064115 = phi i32 [ %.064133, %.critedge ], [ %.064116, %.critedge.thread ]
  %.062111 = phi i1 [ %.062134, %.critedge ], [ %.062112, %.critedge.thread ]
  %.060107 = phi i1 [ %.060135, %.critedge ], [ %.060108, %.critedge.thread ]
  %.059103 = phi i32 [ %.059136, %.critedge ], [ %.059104, %.critedge.thread ]
  %87 = tail call ptr @signal(i32 noundef 13, ptr noundef nonnull @signal_handler) #6
  %88 = tail call ptr @signal(i32 noundef 1, ptr noundef nonnull @signal_handler) #6
  %89 = tail call ptr @signal(i32 noundef 2, ptr noundef nonnull @signal_handler) #6
  %90 = tail call ptr @signal(i32 noundef 15, ptr noundef nonnull @signal_handler) #6
  br i1 %.062111, label %109, label %91

91:                                               ; preds = %86
  %92 = icmp eq i32 %.070123, 2
  %93 = load ptr, ptr @stderr, align 8
  %94 = load ptr, ptr @stdout, align 8
  %95 = select i1 %92, ptr %93, ptr %94
  %96 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 40), align 8, !tbaa !17
  %97 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 16), align 8, !tbaa !18
  %98 = load ptr, ptr getelementptr inbounds (i8, ptr @mdbx_version, i64 24), align 8, !tbaa !20
  %99 = getelementptr inbounds i8, ptr %.074127, i64 8
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  br i1 %92, label %104, label %101

101:                                              ; preds = %91
  %102 = getelementptr inbounds i8, ptr %.074127, i64 16
  %103 = load ptr, ptr %102, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %91, %101
  %105 = phi ptr [ %103, %101 ], [ @.str.3, %91 ]
  %106 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.2, ptr noundef %96, ptr noundef %97, ptr noundef %98, ptr noundef %100, ptr noundef %105) #6
  %107 = tail call i32 @fflush(ptr noundef null)
  %108 = tail call i32 @mdbx_setup_debug(i32 noundef 3, i32 noundef -1, ptr noundef nonnull @logger) #6
  br label %109

109:                                              ; preds = %104, %86
  %110 = call i32 @mdbx_env_create(ptr noundef nonnull %3) #6
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %.thread87

112:                                              ; preds = %109
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %.074127, i64 8
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  %116 = call i32 @mdbx_env_open(ptr noundef %113, ptr noundef %115, i32 noundef %.066119, i32 noundef 0) #6
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %118, label %.thread87

118:                                              ; preds = %112
  br i1 %.060107, label %119, label %.thread89

119:                                              ; preds = %118
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = call i32 @mdbx_env_warmup(ptr noundef %120, ptr noundef null, i32 noundef %.059103, i32 noundef 235929600) #6
  br label %.thread87

.thread87:                                        ; preds = %109, %119, %112
  %.173 = phi i32 [ %121, %119 ], [ %116, %112 ], [ %110, %109 ]
  %.068 = phi ptr [ @.str.5, %119 ], [ @.str.4, %112 ], [ @.str.4, %109 ]
  %122 = add i32 %.173, -1
  %or.cond3 = icmp ult i32 %122, -2
  br i1 %or.cond3, label %.thread93, label %.thread89

.thread89:                                        ; preds = %118, %.thread87
  %123 = icmp eq i32 %.070123, 2
  br i1 %123, label %124, label %129

124:                                              ; preds = %.thread89
  %125 = load ptr, ptr @stdout, align 8, !tbaa !5
  %126 = call i32 @fileno(ptr noundef %125) #6
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = call i32 @mdbx_env_copy2fd(ptr noundef %127, i32 noundef %126, i32 noundef %.064115) #6
  br label %134

129:                                              ; preds = %.thread89
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds i8, ptr %.074127, i64 16
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = call i32 @mdbx_env_copy(ptr noundef %130, ptr noundef %132, i32 noundef %.064115) #6
  br label %134

134:                                              ; preds = %124, %129
  %.2 = phi i32 [ %128, %124 ], [ %133, %129 ]
  %.not.not = icmp eq i32 %.2, 0
  br i1 %.not.not, label %138, label %.thread93

.thread93:                                        ; preds = %.thread87, %134
  %.16998 = phi ptr [ @.str.6, %134 ], [ %.068, %.thread87 ]
  %.297 = phi i32 [ %.2, %134 ], [ %.173, %.thread87 ]
  %135 = load ptr, ptr @stderr, align 8, !tbaa !5
  %136 = call ptr @mdbx_strerror(i32 noundef %.297) #6
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %135, ptr noundef nonnull @.str.7, ptr noundef %4, ptr noundef nonnull %.16998, i32 noundef %.297, ptr noundef %136) #8
  br label %138

138:                                              ; preds = %.thread93, %134
  %.not99 = phi i32 [ 1, %.thread93 ], [ 0, %134 ]
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = call i32 @mdbx_env_close(ptr noundef %139) #6
  br label %141

141:                                              ; preds = %138, %62
  %.0 = phi i32 [ 0, %62 ], [ %.not99, %138 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

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

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

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

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

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

; 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 #5

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

declare i32 @mdbx_env_create(ptr noundef) local_unnamed_addr #5

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

declare i32 @mdbx_env_warmup(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

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

declare i32 @mdbx_env_copy2fd(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

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

declare i32 @mdbx_env_copy(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

declare ptr @mdbx_strerror(i32 noundef) local_unnamed_addr #5

declare i32 @mdbx_env_close(ptr noundef) local_unnamed_addr #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"MDBX_version_info", !12, i64 0, !12, i64 2, !12, i64 4, !12, i64 6, !6, i64 8, !13, i64 16, !6, i64 48}
!12 = !{!"short", !7, i64 0}
!13 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!11, !12, i64 2}
!15 = !{!11, !12, i64 4}
!16 = !{!11, !12, i64 6}
!17 = !{!11, !6, i64 40}
!18 = !{!11, !6, i64 16}
!19 = !{!11, !6, i64 32}
!20 = !{!11, !6, i64 24}
!21 = !{!22, !6, i64 0}
!22 = !{!"MDBX_build_info", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!23 = !{!22, !6, i64 8}
!24 = !{!22, !6, i64 24}
!25 = !{!22, !6, i64 32}
!26 = !{!22, !6, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass