; LLVM IR from erthink/libmdbx :: example (example-mdbx)

; 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.iovec = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [162 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@stderr = external global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [26 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 i32, align 4
  %9 = alloca %struct.iovec, align 8
  %10 = alloca %struct.iovec, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [32 x i8], align 16
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = 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
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store ptr null, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store ptr null, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #8
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store double 0x4270000000000000, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store ptr @.str.1, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %23 = call i64 @mdbx_limits_pgsize_min() #9
  store i64 %23, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %24 = call i64 @mdbx_limits_pgsize_max() #9
  store i64 %24, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %25 = call i64 @mdbx_default_pagesize() #10
  store i64 %25, ptr %18, align 8, !tbaa !13
  %26 = load i64, ptr %16, align 8, !tbaa !13
  %27 = load i64, ptr %17, align 8, !tbaa !13
  %28 = load i64, ptr %18, align 8, !tbaa !13
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %26, i64 noundef %27, i64 noundef %28)
  %30 = call i64 @mdbx_limits_keysize_max(i64 noundef -1, i32 noundef 0) #9
  %31 = load i64, ptr %18, align 8, !tbaa !13
  %32 = udiv i64 %31, 1024
  %33 = load i64, ptr %17, align 8, !tbaa !13
  %34 = call i64 @mdbx_limits_keysize_max(i64 noundef %33, i32 noundef 0) #9
  %35 = load i64, ptr %17, align 8, !tbaa !13
  %36 = udiv i64 %35, 1024
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef 0, i64 noundef %30, i64 noundef %32, i64 noundef %34, i64 noundef %36)
  %38 = load i64, ptr %16, align 8, !tbaa !13
  %39 = call i64 @mdbx_limits_valsize_max(i64 noundef %38, i32 noundef 0) #9
  %40 = load i64, ptr %16, align 8, !tbaa !13
  %41 = call i64 @mdbx_limits_valsize_max(i64 noundef %40, i32 noundef 0) #9
  %42 = call i64 @mdbx_limits_valsize_max(i64 noundef -1, i32 noundef 4) #9
  %43 = load i64, ptr %18, align 8, !tbaa !13
  %44 = udiv i64 %43, 1024
  %45 = load i64, ptr %17, align 8, !tbaa !13
  %46 = call i64 @mdbx_limits_valsize_max(i64 noundef %45, i32 noundef 4) #9
  %47 = load i64, ptr %17, align 8, !tbaa !13
  %48 = udiv i64 %47, 1024
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef 0, i64 noundef %39, i64 noundef %41, i64 noundef %42, i64 noundef %44, i64 noundef %46, i64 noundef %48)
  %50 = load i64, ptr %16, align 8, !tbaa !13
  %51 = call i64 @mdbx_limits_txnsize_max(i64 noundef %50) #9
  %52 = load i64, ptr %16, align 8, !tbaa !13
  %53 = udiv i64 %51, %52
  %54 = load i64, ptr %16, align 8, !tbaa !13
  %55 = call i64 @mdbx_limits_txnsize_max(i64 noundef %54) #9
  %56 = load i64, ptr %16, align 8, !tbaa !13
  %57 = udiv i64 %55, %56
  %58 = call i64 @mdbx_limits_txnsize_max(i64 noundef -1) #9
  %59 = sitofp i64 %58 to double
  %60 = fdiv double %59, 0x4270000000000000
  %61 = load i64, ptr %18, align 8, !tbaa !13
  %62 = udiv i64 %61, 1024
  %63 = load i64, ptr %17, align 8, !tbaa !13
  %64 = call i64 @mdbx_limits_txnsize_max(i64 noundef %63) #9
  %65 = sitofp i64 %64 to double
  %66 = fdiv double %65, 0x4270000000000000
  %67 = load i64, ptr %17, align 8, !tbaa !13
  %68 = udiv i64 %67, 1024
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %53, i64 noundef %57, double noundef %60, ptr noundef @.str.1, i64 noundef %62, double noundef %66, ptr noundef @.str.1, i64 noundef %68)
  %70 = load i64, ptr %16, align 8, !tbaa !13
  %71 = call i64 @mdbx_limits_dbsize_max(i64 noundef %70) #9
  %72 = load i64, ptr %16, align 8, !tbaa !13
  %73 = udiv i64 %71, %72
  %74 = call i64 @mdbx_limits_dbsize_max(i64 noundef -1) #9
  %75 = sitofp i64 %74 to double
  %76 = fdiv double %75, 0x4270000000000000
  %77 = load i64, ptr %18, align 8, !tbaa !13
  %78 = udiv i64 %77, 1024
  %79 = load i64, ptr %17, align 8, !tbaa !13
  %80 = call i64 @mdbx_limits_dbsize_max(i64 noundef %79) #9
  %81 = sitofp i64 %80 to double
  %82 = fdiv double %81, 0x4270000000000000
  %83 = load i64, ptr %17, align 8, !tbaa !13
  %84 = udiv i64 %83, 1024
  %85 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %73, double noundef %76, ptr noundef @.str.1, i64 noundef %78, double noundef %82, ptr noundef @.str.1, i64 noundef %84)
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef 32765)
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %88 = call i32 @mdbx_env_create(ptr noundef %7)
  store i32 %88, ptr %6, align 4, !tbaa !5
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %97

91:                                               ; preds = %2
  %92 = load ptr, ptr @stderr, align 8, !tbaa !9
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = call ptr @mdbx_strerror(i32 noundef %94)
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef @.str.9, i32 noundef %93, ptr noundef %95) #8
  br label %221

97:                                               ; preds = %2
  %98 = load ptr, ptr %7, align 8, !tbaa !9
  %99 = call i32 @mdbx_env_open(ptr noundef %98, ptr noundef @.str.10, i32 noundef 67125248, i32 noundef 436)
  store i32 %99, ptr %6, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %108

102:                                              ; preds = %97
  %103 = load ptr, ptr @stderr, align 8, !tbaa !9
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = call ptr @mdbx_strerror(i32 noundef %105)
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.11, i32 noundef %104, ptr noundef %106) #8
  br label %221

108:                                              ; preds = %97
  %109 = load ptr, ptr %7, align 8, !tbaa !9
  %110 = call i32 @mdbx_txn_begin(ptr noundef %109, ptr noundef null, i32 noundef 0, ptr noundef %11)
  store i32 %110, ptr %6, align 4, !tbaa !5
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %119

113:                                              ; preds = %108
  %114 = load ptr, ptr @stderr, align 8, !tbaa !9
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = call ptr @mdbx_strerror(i32 noundef %116)
  %118 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef @.str.12, i32 noundef %115, ptr noundef %117) #8
  br label %221

119:                                              ; preds = %108
  %120 = load ptr, ptr %11, align 8, !tbaa !9
  %121 = call i32 @mdbx_dbi_open(ptr noundef %120, ptr noundef null, i32 noundef 0, ptr noundef %8)
  store i32 %121, ptr %6, align 4, !tbaa !5
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %130

124:                                              ; preds = %119
  %125 = load ptr, ptr @stderr, align 8, !tbaa !9
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = call ptr @mdbx_strerror(i32 noundef %127)
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.13, i32 noundef %126, ptr noundef %128) #8
  br label %221

130:                                              ; preds = %119
  %131 = getelementptr inbounds %struct.iovec, ptr %9, i32 0, i32 1
  store i64 4, ptr %131, align 8, !tbaa !15
  %132 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %133 = getelementptr inbounds %struct.iovec, ptr %9, i32 0, i32 0
  store ptr %132, ptr %133, align 8, !tbaa !17
  %134 = getelementptr inbounds %struct.iovec, ptr %10, i32 0, i32 1
  store i64 32, ptr %134, align 8, !tbaa !15
  %135 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %136 = getelementptr inbounds %struct.iovec, ptr %10, i32 0, i32 0
  store ptr %135, ptr %136, align 8, !tbaa !17
  %137 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %138 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %137, ptr noundef @.str.14, i32 noundef 32, i32 noundef 3141592) #8
  %139 = load ptr, ptr %11, align 8, !tbaa !9
  %140 = load i32, ptr %8, align 4, !tbaa !5
  %141 = call i32 @mdbx_put(ptr noundef %139, i32 noundef %140, ptr noundef %9, ptr noundef %10, i32 noundef 0)
  store i32 %141, ptr %6, align 4, !tbaa !5
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %150

144:                                              ; preds = %130
  %145 = load ptr, ptr @stderr, align 8, !tbaa !9
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = call ptr @mdbx_strerror(i32 noundef %147)
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str.15, i32 noundef %146, ptr noundef %148) #8
  br label %221

150:                                              ; preds = %130
  %151 = load ptr, ptr %11, align 8, !tbaa !9
  %152 = call i32 @mdbx_txn_commit(ptr noundef %151)
  store i32 %152, ptr %6, align 4, !tbaa !5
  %153 = load i32, ptr %6, align 4, !tbaa !5
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %161

155:                                              ; preds = %150
  %156 = load ptr, ptr @stderr, align 8, !tbaa !9
  %157 = load i32, ptr %6, align 4, !tbaa !5
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = call ptr @mdbx_strerror(i32 noundef %158)
  %160 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.16, i32 noundef %157, ptr noundef %159) #8
  br label %221

161:                                              ; preds = %150
  store ptr null, ptr %11, align 8, !tbaa !9
  %162 = load ptr, ptr %7, align 8, !tbaa !9
  %163 = call i32 @mdbx_txn_begin(ptr noundef %162, ptr noundef null, i32 noundef 131072, ptr noundef %11)
  store i32 %163, ptr %6, align 4, !tbaa !5
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %172

166:                                              ; preds = %161
  %167 = load ptr, ptr @stderr, align 8, !tbaa !9
  %168 = load i32, ptr %6, align 4, !tbaa !5
  %169 = load i32, ptr %6, align 4, !tbaa !5
  %170 = call ptr @mdbx_strerror(i32 noundef %169)
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %167, ptr noundef @.str.12, i32 noundef %168, ptr noundef %170) #8
  br label %221

172:                                              ; preds = %161
  %173 = load ptr, ptr %11, align 8, !tbaa !9
  %174 = load i32, ptr %8, align 4, !tbaa !5
  %175 = call i32 @mdbx_cursor_open(ptr noundef %173, i32 noundef %174, ptr noundef %12)
  store i32 %175, ptr %6, align 4, !tbaa !5
  %176 = load i32, ptr %6, align 4, !tbaa !5
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %184

178:                                              ; preds = %172
  %179 = load ptr, ptr @stderr, align 8, !tbaa !9
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = load i32, ptr %6, align 4, !tbaa !5
  %182 = call ptr @mdbx_strerror(i32 noundef %181)
  %183 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.17, i32 noundef %180, ptr noundef %182) #8
  br label %221

184:                                              ; preds = %172
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %189, %184
  %186 = load ptr, ptr %12, align 8, !tbaa !9
  %187 = call i32 @mdbx_cursor_get(ptr noundef %186, ptr noundef %9, ptr noundef %10, i32 noundef 8)
  store i32 %187, ptr %6, align 4, !tbaa !5
  %188 = icmp eq i32 %187, 0
  br i1 %188, label %189, label %207

189:                                              ; preds = %185
  %190 = getelementptr inbounds %struct.iovec, ptr %9, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !17
  %192 = getelementptr inbounds %struct.iovec, ptr %9, i32 0, i32 1
  %193 = load i64, ptr %192, align 8, !tbaa !15
  %194 = trunc i64 %193 to i32
  %195 = getelementptr inbounds %struct.iovec, ptr %9, i32 0, i32 0
  %196 = load ptr, ptr %195, align 8, !tbaa !17
  %197 = getelementptr inbounds %struct.iovec, ptr %10, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !17
  %199 = getelementptr inbounds %struct.iovec, ptr %10, i32 0, i32 1
  %200 = load i64, ptr %199, align 8, !tbaa !15
  %201 = trunc i64 %200 to i32
  %202 = getelementptr inbounds %struct.iovec, ptr %10, i32 0, i32 0
  %203 = load ptr, ptr %202, align 8, !tbaa !17
  %204 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, ptr noundef %191, i32 noundef %194, ptr noundef %196, ptr noundef %198, i32 noundef %201, ptr noundef %203)
  %205 = load i32, ptr %19, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %19, align 4, !tbaa !5
  br label %185, !llvm.loop !18

207:                                              ; preds = %185
  %208 = load i32, ptr %6, align 4, !tbaa !5
  %209 = icmp ne i32 %208, -30798
  br i1 %209, label %213, label %210

210:                                              ; preds = %207
  %211 = load i32, ptr %19, align 4, !tbaa !5
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %213, label %219

213:                                              ; preds = %210, %207
  %214 = load ptr, ptr @stderr, align 8, !tbaa !9
  %215 = load i32, ptr %6, align 4, !tbaa !5
  %216 = load i32, ptr %6, align 4, !tbaa !5
  %217 = call ptr @mdbx_strerror(i32 noundef %216)
  %218 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %214, ptr noundef @.str.19, i32 noundef %215, ptr noundef %217) #8
  br label %221

219:                                              ; preds = %210
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %220

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220, %213, %178, %166, %155, %144, %124, %113, %102, %91
  %222 = load ptr, ptr %12, align 8, !tbaa !9
  %223 = icmp ne ptr %222, null
  br i1 %223, label %224, label %226

224:                                              ; preds = %221
  %225 = load ptr, ptr %12, align 8, !tbaa !9
  call void @mdbx_cursor_close(ptr noundef %225)
  br label %226

226:                                              ; preds = %224, %221
  %227 = load ptr, ptr %11, align 8, !tbaa !9
  %228 = icmp ne ptr %227, null
  br i1 %228, label %229, label %232

229:                                              ; preds = %226
  %230 = load ptr, ptr %11, align 8, !tbaa !9
  %231 = call i32 @mdbx_txn_abort(ptr noundef %230)
  br label %232

232:                                              ; preds = %229, %226
  %233 = load i32, ptr %8, align 4, !tbaa !5
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %239

235:                                              ; preds = %232
  %236 = load ptr, ptr %7, align 8, !tbaa !9
  %237 = load i32, ptr %8, align 4, !tbaa !5
  %238 = call i32 @mdbx_dbi_close(ptr noundef %236, i32 noundef %237)
  br label %239

239:                                              ; preds = %235, %232
  %240 = load ptr, ptr %7, align 8, !tbaa !9
  %241 = icmp ne ptr %240, null
  br i1 %241, label %242, label %245

242:                                              ; preds = %239
  %243 = load ptr, ptr %7, align 8, !tbaa !9
  %244 = call i32 @mdbx_env_close(ptr noundef %243)
  br label %245

245:                                              ; preds = %242, %239
  %246 = load i32, ptr %6, align 4, !tbaa !5
  %247 = icmp ne i32 %246, 0
  %248 = zext i1 %247 to i64
  %249 = select i1 %247, i32 1, i32 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  ret i32 %249
}

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

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

; Function Attrs: inlinehint nounwind willreturn memory(none) uwtable
declare hidden i64 @mdbx_limits_pgsize_min() #3

; Function Attrs: inlinehint nounwind willreturn memory(none) uwtable
declare hidden i64 @mdbx_limits_pgsize_max() #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @mdbx_default_pagesize() #4

; Function Attrs: nounwind willreturn memory(none)
declare i64 @mdbx_limits_keysize_max(i64 noundef, i32 noundef) #5

; Function Attrs: nounwind willreturn memory(none)
declare i64 @mdbx_limits_valsize_max(i64 noundef, i32 noundef) #5

; Function Attrs: nounwind willreturn memory(none)
declare i64 @mdbx_limits_txnsize_max(i64 noundef) #5

; Function Attrs: nounwind willreturn memory(none)
declare i64 @mdbx_limits_dbsize_max(i64 noundef) #5

declare i32 @mdbx_env_create(ptr noundef) #2

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

declare ptr @mdbx_strerror(i32 noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mdbx_txn_begin(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #6

declare i32 @mdbx_put(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mdbx_txn_commit(ptr noundef) #7

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

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

declare void @mdbx_cursor_close(ptr noundef) #2

declare i32 @mdbx_txn_abort(ptr noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mdbx_env_close(ptr noundef) #7

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 = { 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { 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 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !14, i64 8}
!16 = !{!"iovec", !10, i64 0, !14, i64 8}
!17 = !{!16, !10, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; 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.iovec = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [162 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %struct.iovec, align 8
  %6 = alloca %struct.iovec, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #8
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %11 = tail call i64 @mdbx_limits_pgsize_min() #9
  %12 = tail call i64 @mdbx_limits_pgsize_max() #9
  %13 = tail call i64 @mdbx_default_pagesize() #10
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %11, i64 noundef %12, i64 noundef %13)
  %15 = tail call i64 @mdbx_limits_keysize_max(i64 noundef -1, i32 noundef 0) #9
  %16 = lshr i64 %13, 10
  %17 = tail call i64 @mdbx_limits_keysize_max(i64 noundef %12, i32 noundef 0) #9
  %18 = lshr i64 %12, 10
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef 0, i64 noundef %15, i64 noundef %16, i64 noundef %17, i64 noundef %18)
  %20 = tail call i64 @mdbx_limits_valsize_max(i64 noundef %11, i32 noundef 0) #9
  %21 = tail call i64 @mdbx_limits_valsize_max(i64 noundef -1, i32 noundef 4) #9
  %22 = tail call i64 @mdbx_limits_valsize_max(i64 noundef %12, i32 noundef 4) #9
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef 0, i64 noundef %20, i64 noundef %20, i64 noundef %21, i64 noundef %16, i64 noundef %22, i64 noundef %18)
  %24 = tail call i64 @mdbx_limits_txnsize_max(i64 noundef %11) #9
  %25 = udiv i64 %24, %11
  %26 = tail call i64 @mdbx_limits_txnsize_max(i64 noundef -1) #9
  %27 = sitofp i64 %26 to double
  %28 = fmul double %27, 0x3D70000000000000
  %29 = tail call i64 @mdbx_limits_txnsize_max(i64 noundef %12) #9
  %30 = sitofp i64 %29 to double
  %31 = fmul double %30, 0x3D70000000000000
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %25, i64 noundef %25, double noundef %28, ptr noundef nonnull @.str.1, i64 noundef %16, double noundef %31, ptr noundef nonnull @.str.1, i64 noundef %18)
  %33 = tail call i64 @mdbx_limits_dbsize_max(i64 noundef %11) #9
  %34 = udiv i64 %33, %11
  %35 = tail call i64 @mdbx_limits_dbsize_max(i64 noundef -1) #9
  %36 = sitofp i64 %35 to double
  %37 = fmul double %36, 0x3D70000000000000
  %38 = tail call i64 @mdbx_limits_dbsize_max(i64 noundef %12) #9
  %39 = sitofp i64 %38 to double
  %40 = fmul double %39, 0x3D70000000000000
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %34, double noundef %37, ptr noundef nonnull @.str.1, i64 noundef %16, double noundef %40, ptr noundef nonnull @.str.1, i64 noundef %18)
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 32765)
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %44 = call i32 @mdbx_env_create(ptr noundef nonnull %3) #8
  %.not = icmp eq i32 %44, 0
  br i1 %.not, label %49, label %45

45:                                               ; preds = %2
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = call ptr @mdbx_strerror(i32 noundef %44) #8
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.9, i32 noundef %44, ptr noundef %47) #11
  br label %120

49:                                               ; preds = %2
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = call i32 @mdbx_env_open(ptr noundef %50, ptr noundef nonnull @.str.10, i32 noundef 67125248, i32 noundef 436) #8
  %.not69 = icmp eq i32 %51, 0
  br i1 %.not69, label %56, label %52

52:                                               ; preds = %49
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call ptr @mdbx_strerror(i32 noundef %51) #8
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.11, i32 noundef %51, ptr noundef %54) #11
  br label %120

56:                                               ; preds = %49
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = call i32 @mdbx_txn_begin(ptr noundef %57, ptr noundef null, i32 noundef 0, ptr noundef nonnull %7)
  %.not70 = icmp eq i32 %58, 0
  br i1 %.not70, label %63, label %59

59:                                               ; preds = %56
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = call ptr @mdbx_strerror(i32 noundef %58) #8
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.12, i32 noundef %58, ptr noundef %61) #11
  br label %120

63:                                               ; preds = %56
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = call i32 @mdbx_dbi_open(ptr noundef %64, ptr noundef null, i32 noundef 0, ptr noundef nonnull %4) #8
  %.not71 = icmp eq i32 %65, 0
  br i1 %.not71, label %70, label %66

66:                                               ; preds = %63
  %67 = load ptr, ptr @stderr, align 8, !tbaa !5
  %68 = call ptr @mdbx_strerror(i32 noundef %65) #8
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.13, i32 noundef %65, ptr noundef %68) #11
  br label %120

70:                                               ; preds = %63
  %71 = getelementptr inbounds i8, ptr %5, i64 8
  store i64 4, ptr %71, align 8, !tbaa !11
  store ptr %9, ptr %5, align 8, !tbaa !14
  %72 = getelementptr inbounds i8, ptr %6, i64 8
  store i64 32, ptr %72, align 8, !tbaa !11
  store ptr %9, ptr %6, align 8, !tbaa !14
  %73 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef 32, i32 noundef 3141592) #8
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !9
  %76 = call i32 @mdbx_put(ptr noundef %74, i32 noundef %75, ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef 0) #8
  %.not72 = icmp eq i32 %76, 0
  br i1 %.not72, label %81, label %77

77:                                               ; preds = %70
  %78 = load ptr, ptr @stderr, align 8, !tbaa !5
  %79 = call ptr @mdbx_strerror(i32 noundef %76) #8
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.15, i32 noundef %76, ptr noundef %79) #11
  br label %120

81:                                               ; preds = %70
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = call i32 @mdbx_txn_commit(ptr noundef %82)
  %.not73 = icmp eq i32 %83, 0
  br i1 %.not73, label %88, label %84

84:                                               ; preds = %81
  %85 = load ptr, ptr @stderr, align 8, !tbaa !5
  %86 = call ptr @mdbx_strerror(i32 noundef %83) #8
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.16, i32 noundef %83, ptr noundef %86) #11
  br label %120

88:                                               ; preds = %81
  store ptr null, ptr %7, align 8, !tbaa !5
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = call i32 @mdbx_txn_begin(ptr noundef %89, ptr noundef null, i32 noundef 131072, ptr noundef nonnull %7)
  %.not74 = icmp eq i32 %90, 0
  br i1 %.not74, label %95, label %91

91:                                               ; preds = %88
  %92 = load ptr, ptr @stderr, align 8, !tbaa !5
  %93 = call ptr @mdbx_strerror(i32 noundef %90) #8
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef nonnull @.str.12, i32 noundef %90, ptr noundef %93) #11
  br label %120

95:                                               ; preds = %88
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = load i32, ptr %4, align 4, !tbaa !9
  %98 = call i32 @mdbx_cursor_open(ptr noundef %96, i32 noundef %97, ptr noundef nonnull %8) #8
  %.not75 = icmp eq i32 %98, 0
  br i1 %.not75, label %.preheader, label %102

.preheader:                                       ; preds = %95
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = call i32 @mdbx_cursor_get(ptr noundef %99, ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef 8) #8
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %._crit_edge.thread, label %.lr.ph

102:                                              ; preds = %95
  %103 = load ptr, ptr @stderr, align 8, !tbaa !5
  %104 = call ptr @mdbx_strerror(i32 noundef %98) #8
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef nonnull @.str.17, i32 noundef %98, ptr noundef %104) #11
  br label %120

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %106 = load ptr, ptr %5, align 8, !tbaa !14
  %107 = load i64, ptr %71, align 8, !tbaa !11
  %108 = trunc i64 %107 to i32
  %109 = load ptr, ptr %6, align 8, !tbaa !14
  %110 = load i64, ptr %72, align 8, !tbaa !11
  %111 = trunc i64 %110 to i32
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef %106, i32 noundef %108, ptr noundef %106, ptr noundef %109, i32 noundef %111, ptr noundef %109)
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = call i32 @mdbx_cursor_get(ptr noundef %113, ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef 8) #8
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph
  %116 = icmp ne i32 %114, -30798
  %or.cond = or i1 %116, %101
  br i1 %or.cond, label %._crit_edge.thread, label %120

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge
  %.lcssa86 = phi i32 [ %114, %._crit_edge ], [ %100, %.preheader ]
  %117 = load ptr, ptr @stderr, align 8, !tbaa !5
  %118 = call ptr @mdbx_strerror(i32 noundef %.lcssa86) #8
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef nonnull @.str.19, i32 noundef %.lcssa86, ptr noundef %118) #11
  br label %120

120:                                              ; preds = %._crit_edge, %._crit_edge.thread, %102, %91, %84, %77, %66, %59, %52, %45
  %not..not80 = phi i32 [ 1, %45 ], [ 1, %52 ], [ 1, %59 ], [ 1, %66 ], [ 1, %77 ], [ 1, %84 ], [ 1, %91 ], [ 1, %102 ], [ 1, %._crit_edge.thread ], [ 0, %._crit_edge ]
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %.not76 = icmp eq ptr %121, null
  br i1 %.not76, label %123, label %122

122:                                              ; preds = %120
  call void @mdbx_cursor_close(ptr noundef nonnull %121) #8
  br label %123

123:                                              ; preds = %122, %120
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %.not77 = icmp eq ptr %124, null
  br i1 %.not77, label %127, label %125

125:                                              ; preds = %123
  %126 = call i32 @mdbx_txn_abort(ptr noundef nonnull %124) #8
  br label %127

127:                                              ; preds = %125, %123
  %128 = load i32, ptr %4, align 4, !tbaa !9
  %.not78 = icmp eq i32 %128, 0
  br i1 %.not78, label %132, label %129

129:                                              ; preds = %127
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = call i32 @mdbx_dbi_close(ptr noundef %130, i32 noundef %128) #8
  br label %132

132:                                              ; preds = %129, %127
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %.not79 = icmp eq ptr %133, null
  br i1 %.not79, label %136, label %134

134:                                              ; preds = %132
  %135 = call i32 @mdbx_env_close(ptr noundef nonnull %133)
  br label %136

136:                                              ; preds = %134, %132
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  ret i32 %not..not80
}

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

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

; Function Attrs: inlinehint mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare hidden i64 @mdbx_limits_pgsize_min() local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare hidden i64 @mdbx_limits_pgsize_max() local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i64 @mdbx_default_pagesize() local_unnamed_addr #4

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @mdbx_limits_keysize_max(i64 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @mdbx_limits_valsize_max(i64 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @mdbx_limits_txnsize_max(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @mdbx_limits_dbsize_max(i64 noundef) local_unnamed_addr #5

declare i32 @mdbx_env_create(ptr noundef) local_unnamed_addr #6

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

declare ptr @mdbx_strerror(i32 noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mdbx_txn_begin(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

declare i32 @mdbx_put(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mdbx_txn_commit(ptr noundef) local_unnamed_addr #7

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

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

declare void @mdbx_cursor_close(ptr noundef) local_unnamed_addr #6

declare i32 @mdbx_txn_abort(ptr noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mdbx_env_close(ptr noundef) local_unnamed_addr #7

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

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 = { 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 #3 = { inlinehint mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { "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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"iovec", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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