; LLVM IR from erthink/libmdbx :: test/extra (upsert_alldups)

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

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.29 = 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 ptr, align 8
  %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 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
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !9
  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
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  %15 = call i32 @unlink(ptr noundef @.str) #5
  %16 = call i32 @unlink(ptr noundef @.str.1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  %17 = call i32 @mdbx_env_create(ptr noundef %7)
  store i32 %17, ptr %11, align 4, !tbaa !5
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  store ptr @.str.2, ptr %6, align 8, !tbaa !9
  br label %214

20:                                               ; preds = %2
  %21 = load ptr, ptr %7, align 8, !tbaa !9
  %22 = call i32 @mdbx_env_open(ptr noundef %21, ptr noundef @.str.3, i32 noundef 67125248, i32 noundef 420)
  store i32 %22, ptr %11, align 4, !tbaa !5
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  store ptr @.str.4, ptr %6, align 8, !tbaa !9
  br label %214

25:                                               ; preds = %20
  %26 = load ptr, ptr %7, align 8, !tbaa !9
  %27 = call i32 @mdbx_txn_begin(ptr noundef %26, ptr noundef null, i32 noundef 0, ptr noundef %8)
  store i32 %27, ptr %11, align 4, !tbaa !5
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  store ptr @.str.5, ptr %6, align 8, !tbaa !9
  br label %214

30:                                               ; preds = %25
  %31 = load ptr, ptr %8, align 8, !tbaa !9
  %32 = call i32 @mdbx_dbi_open(ptr noundef %31, ptr noundef null, i32 noundef 262148, ptr noundef %10)
  store i32 %32, ptr %11, align 4, !tbaa !5
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  store ptr @.str.6, ptr %6, align 8, !tbaa !9
  br label %214

35:                                               ; preds = %30
  %36 = load ptr, ptr %8, align 8, !tbaa !9
  %37 = load i32, ptr %10, align 4, !tbaa !5
  %38 = call i32 @mdbx_cursor_open(ptr noundef %36, i32 noundef %37, ptr noundef %9)
  store i32 %38, ptr %11, align 4, !tbaa !5
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %35
  store ptr @.str.7, ptr %6, align 8, !tbaa !9
  br label %214

41:                                               ; preds = %35
  %42 = call i32 @puts(ptr noundef @.str.8)
  %43 = call i32 @puts(ptr noundef @.str.9)
  %44 = call i32 @puts(ptr noundef @.str.10)
  %45 = call i32 @puts(ptr noundef @.str.11)
  %46 = call i32 @puts(ptr noundef @.str.12)
  br label %47

47:                                               ; preds = %41
  %48 = load ptr, ptr %8, align 8, !tbaa !9
  %49 = load i32, ptr %10, align 4, !tbaa !5
  %50 = call i32 @put(ptr noundef %48, i32 noundef %49, ptr noundef @.str.13, ptr noundef @.str.14, i32 noundef 0)
  store i32 %50, ptr %11, align 4, !tbaa !5
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %47
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

53:                                               ; preds = %47
  br label %54

54:                                               ; preds = %53
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  %57 = load ptr, ptr %8, align 8, !tbaa !9
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = call i32 @put(ptr noundef %57, i32 noundef %58, ptr noundef @.str.13, ptr noundef @.str.16, i32 noundef 0)
  store i32 %59, ptr %11, align 4, !tbaa !5
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %56
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

62:                                               ; preds = %56
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = load ptr, ptr %8, align 8, !tbaa !9
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = call i32 @put(ptr noundef %66, i32 noundef %67, ptr noundef @.str.13, ptr noundef @.str.17, i32 noundef 0)
  store i32 %68, ptr %11, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %65
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

71:                                               ; preds = %65
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %8, align 8, !tbaa !9
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = call i32 @put(ptr noundef %75, i32 noundef %76, ptr noundef @.str.18, ptr noundef @.str.19, i32 noundef 0)
  store i32 %77, ptr %11, align 4, !tbaa !5
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %74
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

80:                                               ; preds = %74
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %9, align 8, !tbaa !9
  %85 = call i32 @dump(ptr noundef %84)
  store i32 %85, ptr %11, align 4, !tbaa !5
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %91

87:                                               ; preds = %83
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = icmp ne i32 %88, -30798
  br i1 %89, label %90, label %91

90:                                               ; preds = %87
  store ptr @.str.20, ptr %6, align 8, !tbaa !9
  br label %214

91:                                               ; preds = %87, %83
  %92 = call i32 @puts(ptr noundef @.str.21)
  br label %93

93:                                               ; preds = %91
  br label %94

94:                                               ; preds = %93
  %95 = call i32 @puts(ptr noundef @.str.22)
  %96 = call i32 @puts(ptr noundef @.str.23)
  %97 = call i32 @puts(ptr noundef @.str.12)
  br label %98

98:                                               ; preds = %94
  %99 = load ptr, ptr %8, align 8, !tbaa !9
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = call i32 @put(ptr noundef %99, i32 noundef %100, ptr noundef @.str.13, ptr noundef @.str.24, i32 noundef 128)
  store i32 %101, ptr %11, align 4, !tbaa !5
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %98
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

104:                                              ; preds = %98
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %9, align 8, !tbaa !9
  %109 = call i32 @dump(ptr noundef %108)
  store i32 %109, ptr %11, align 4, !tbaa !5
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %115

111:                                              ; preds = %107
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = icmp ne i32 %112, -30798
  br i1 %113, label %114, label %115

114:                                              ; preds = %111
  store ptr @.str.20, ptr %6, align 8, !tbaa !9
  br label %214

115:                                              ; preds = %111, %107
  %116 = call i32 @puts(ptr noundef @.str.21)
  br label %117

117:                                              ; preds = %115
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %9, align 8, !tbaa !9
  %120 = call i32 @clear(ptr noundef %119)
  store i32 %120, ptr %11, align 4, !tbaa !5
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %123

122:                                              ; preds = %118
  store ptr @.str.25, ptr %6, align 8, !tbaa !9
  br label %214

123:                                              ; preds = %118
  br label %124

124:                                              ; preds = %123
  %125 = load ptr, ptr %9, align 8, !tbaa !9
  %126 = call i32 @dump(ptr noundef %125)
  store i32 %126, ptr %11, align 4, !tbaa !5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %132

128:                                              ; preds = %124
  %129 = load i32, ptr %11, align 4, !tbaa !5
  %130 = icmp ne i32 %129, -30798
  br i1 %130, label %131, label %132

131:                                              ; preds = %128
  store ptr @.str.20, ptr %6, align 8, !tbaa !9
  br label %214

132:                                              ; preds = %128, %124
  %133 = call i32 @puts(ptr noundef @.str.21)
  br label %134

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134
  %136 = call i32 @puts(ptr noundef @.str.26)
  %137 = call i32 @puts(ptr noundef @.str.27)
  %138 = call i32 @puts(ptr noundef @.str.10)
  %139 = call i32 @puts(ptr noundef @.str.12)
  br label %140

140:                                              ; preds = %135
  %141 = load ptr, ptr %8, align 8, !tbaa !9
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = call i32 @put(ptr noundef %141, i32 noundef %142, ptr noundef @.str.13, ptr noundef @.str.14, i32 noundef 0)
  store i32 %143, ptr %11, align 4, !tbaa !5
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %140
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

146:                                              ; preds = %140
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %8, align 8, !tbaa !9
  %151 = load i32, ptr %10, align 4, !tbaa !5
  %152 = call i32 @put(ptr noundef %150, i32 noundef %151, ptr noundef @.str.13, ptr noundef @.str.16, i32 noundef 0)
  store i32 %152, ptr %11, align 4, !tbaa !5
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %155

154:                                              ; preds = %149
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

155:                                              ; preds = %149
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr %8, align 8, !tbaa !9
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = call i32 @put(ptr noundef %159, i32 noundef %160, ptr noundef @.str.13, ptr noundef @.str.17, i32 noundef 0)
  store i32 %161, ptr %11, align 4, !tbaa !5
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %163, label %164

163:                                              ; preds = %158
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

164:                                              ; preds = %158
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %9, align 8, !tbaa !9
  %169 = call i32 @dump(ptr noundef %168)
  store i32 %169, ptr %11, align 4, !tbaa !5
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %175

171:                                              ; preds = %167
  %172 = load i32, ptr %11, align 4, !tbaa !5
  %173 = icmp ne i32 %172, -30798
  br i1 %173, label %174, label %175

174:                                              ; preds = %171
  store ptr @.str.20, ptr %6, align 8, !tbaa !9
  br label %214

175:                                              ; preds = %171, %167
  %176 = call i32 @puts(ptr noundef @.str.21)
  br label %177

177:                                              ; preds = %175
  br label %178

178:                                              ; preds = %177
  %179 = call i32 @puts(ptr noundef @.str.22)
  %180 = call i32 @puts(ptr noundef @.str.23)
  %181 = call i32 @puts(ptr noundef @.str.12)
  br label %182

182:                                              ; preds = %178
  %183 = load ptr, ptr %8, align 8, !tbaa !9
  %184 = load i32, ptr %10, align 4, !tbaa !5
  %185 = call i32 @put(ptr noundef %183, i32 noundef %184, ptr noundef @.str.13, ptr noundef @.str.24, i32 noundef 128)
  store i32 %185, ptr %11, align 4, !tbaa !5
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %187, label %188

187:                                              ; preds = %182
  store ptr @.str.15, ptr %6, align 8, !tbaa !9
  br label %214

188:                                              ; preds = %182
  br label %189

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189
  br label %191

191:                                              ; preds = %190
  %192 = load ptr, ptr %9, align 8, !tbaa !9
  %193 = call i32 @dump(ptr noundef %192)
  store i32 %193, ptr %11, align 4, !tbaa !5
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %199

195:                                              ; preds = %191
  %196 = load i32, ptr %11, align 4, !tbaa !5
  %197 = icmp ne i32 %196, -30798
  br i1 %197, label %198, label %199

198:                                              ; preds = %195
  store ptr @.str.20, ptr %6, align 8, !tbaa !9
  br label %214

199:                                              ; preds = %195, %191
  %200 = call i32 @puts(ptr noundef @.str.21)
  br label %201

201:                                              ; preds = %199
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %8, align 8, !tbaa !9
  %204 = call i32 @mdbx_txn_commit(ptr noundef %203)
  store i32 %204, ptr %11, align 4, !tbaa !5
  %205 = icmp ne i32 %204, 0
  br i1 %205, label %206, label %207

206:                                              ; preds = %202
  store ptr @.str.28, ptr %6, align 8, !tbaa !9
  br label %214

207:                                              ; preds = %202
  %208 = load ptr, ptr %9, align 8, !tbaa !9
  call void @mdbx_cursor_close(ptr noundef %208)
  %209 = load ptr, ptr %7, align 8, !tbaa !9
  %210 = call i32 @mdbx_env_close(ptr noundef %209)
  store i32 %210, ptr %11, align 4, !tbaa !5
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %212, label %213

212:                                              ; preds = %207
  store ptr @.str.29, ptr %6, align 8, !tbaa !9
  br label %214

213:                                              ; preds = %207
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %219

214:                                              ; preds = %212, %206, %198, %187, %174, %163, %154, %145, %131, %122, %114, %103, %90, %79, %70, %61, %52, %40, %34, %29, %24, %19
  %215 = load ptr, ptr %6, align 8, !tbaa !9
  %216 = load i32, ptr %11, align 4, !tbaa !5
  %217 = call ptr @mdbx_strerror(i32 noundef %216)
  %218 = call i32 (ptr, ...) @printf(ptr noundef %215, ptr noundef %217)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %219

219:                                              ; preds = %214, %213
  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 8, ptr %6) #5
  %220 = load i32, ptr %3, align 4
  ret i32 %220
}

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

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

declare i32 @mdbx_env_create(ptr noundef) #3

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

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

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

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

declare i32 @puts(ptr noundef) #3

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

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

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

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

declare void @mdbx_cursor_close(ptr noundef) #3

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

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

declare ptr @mdbx_strerror(i32 noundef) #3

; 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 = { 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 = { 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 #5 = { 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 = !{!"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}


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

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.29 = 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 readnone %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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  %7 = tail call i32 @unlink(ptr noundef nonnull @.str) #5
  %8 = tail call i32 @unlink(ptr noundef nonnull @.str.1) #5
  %9 = call i32 @mdbx_env_create(ptr noundef nonnull %3) #5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %104

10:                                               ; preds = %2
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = call i32 @mdbx_env_open(ptr noundef %11, ptr noundef nonnull @.str.3, i32 noundef 67125248, i32 noundef 420) #5
  %.not42 = icmp eq i32 %12, 0
  br i1 %.not42, label %13, label %104

13:                                               ; preds = %10
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = call i32 @mdbx_txn_begin(ptr noundef %14, ptr noundef null, i32 noundef 0, ptr noundef nonnull %4)
  %.not43 = icmp eq i32 %15, 0
  br i1 %.not43, label %16, label %104

16:                                               ; preds = %13
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = call i32 @mdbx_dbi_open(ptr noundef %17, ptr noundef null, i32 noundef 262148, ptr noundef nonnull %6) #5
  %.not44 = icmp eq i32 %18, 0
  br i1 %.not44, label %19, label %104

19:                                               ; preds = %16
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = call i32 @mdbx_cursor_open(ptr noundef %20, i32 noundef %21, ptr noundef nonnull %5) #5
  %.not45 = icmp eq i32 %22, 0
  br i1 %.not45, label %23, label %104

23:                                               ; preds = %19
  %24 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.8)
  %25 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.9)
  %26 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.10)
  %27 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.11)
  %28 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.12)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = call i32 @put(ptr noundef %29, i32 noundef %30, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.14, i32 noundef 0)
  %.not46 = icmp eq i32 %31, 0
  br i1 %.not46, label %32, label %104

32:                                               ; preds = %23
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = call i32 @put(ptr noundef %33, i32 noundef %34, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.16, i32 noundef 0)
  %.not47 = icmp eq i32 %35, 0
  br i1 %.not47, label %36, label %104

36:                                               ; preds = %32
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = call i32 @put(ptr noundef %37, i32 noundef %38, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.17, i32 noundef 0)
  %.not48 = icmp eq i32 %39, 0
  br i1 %.not48, label %40, label %104

40:                                               ; preds = %36
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = call i32 @put(ptr noundef %41, i32 noundef %42, ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.19, i32 noundef 0)
  %.not49 = icmp eq i32 %43, 0
  br i1 %.not49, label %44, label %104

44:                                               ; preds = %40
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call i32 @dump(ptr noundef %45)
  switch i32 %46, label %104 [
    i32 -30798, label %47
    i32 0, label %47
  ]

47:                                               ; preds = %44, %44
  %48 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.21)
  %49 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.22)
  %50 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.23)
  %51 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.12)
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = call i32 @put(ptr noundef %52, i32 noundef %53, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.24, i32 noundef 128)
  %.not50 = icmp eq i32 %54, 0
  br i1 %.not50, label %55, label %104

55:                                               ; preds = %47
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = call i32 @dump(ptr noundef %56)
  switch i32 %57, label %104 [
    i32 -30798, label %58
    i32 0, label %58
  ]

58:                                               ; preds = %55, %55
  %59 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.21)
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call i32 @clear(ptr noundef %60)
  %.not51 = icmp eq i32 %61, 0
  br i1 %.not51, label %62, label %104

62:                                               ; preds = %58
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = call i32 @dump(ptr noundef %63)
  switch i32 %64, label %104 [
    i32 -30798, label %65
    i32 0, label %65
  ]

65:                                               ; preds = %62, %62
  %66 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.21)
  %67 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.26)
  %68 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.27)
  %69 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.10)
  %70 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.12)
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = call i32 @put(ptr noundef %71, i32 noundef %72, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.14, i32 noundef 0)
  %.not52 = icmp eq i32 %73, 0
  br i1 %.not52, label %74, label %104

74:                                               ; preds = %65
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load i32, ptr %6, align 4, !tbaa !9
  %77 = call i32 @put(ptr noundef %75, i32 noundef %76, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.16, i32 noundef 0)
  %.not53 = icmp eq i32 %77, 0
  br i1 %.not53, label %78, label %104

78:                                               ; preds = %74
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = call i32 @put(ptr noundef %79, i32 noundef %80, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.17, i32 noundef 0)
  %.not54 = icmp eq i32 %81, 0
  br i1 %.not54, label %82, label %104

82:                                               ; preds = %78
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = call i32 @dump(ptr noundef %83)
  switch i32 %84, label %104 [
    i32 -30798, label %85
    i32 0, label %85
  ]

85:                                               ; preds = %82, %82
  %86 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.21)
  %87 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.22)
  %88 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.23)
  %89 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.12)
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = call i32 @put(ptr noundef %90, i32 noundef %91, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.24, i32 noundef 128)
  %.not55 = icmp eq i32 %92, 0
  br i1 %.not55, label %93, label %104

93:                                               ; preds = %85
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = call i32 @dump(ptr noundef %94)
  switch i32 %95, label %104 [
    i32 -30798, label %96
    i32 0, label %96
  ]

96:                                               ; preds = %93, %93
  %97 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.21)
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = call i32 @mdbx_txn_commit(ptr noundef %98)
  %.not56 = icmp eq i32 %99, 0
  br i1 %.not56, label %100, label %104

100:                                              ; preds = %96
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mdbx_cursor_close(ptr noundef %101) #5
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = call i32 @mdbx_env_close(ptr noundef %102)
  %.not57 = icmp eq i32 %103, 0
  br i1 %.not57, label %107, label %104

104:                                              ; preds = %100, %96, %93, %85, %82, %78, %74, %65, %62, %58, %55, %47, %44, %40, %36, %32, %23, %19, %16, %13, %10, %2
  %.018 = phi ptr [ @.str.2, %2 ], [ @.str.4, %10 ], [ @.str.5, %13 ], [ @.str.6, %16 ], [ @.str.7, %19 ], [ @.str.15, %23 ], [ @.str.15, %32 ], [ @.str.15, %36 ], [ @.str.15, %40 ], [ @.str.20, %44 ], [ @.str.15, %47 ], [ @.str.20, %55 ], [ @.str.25, %58 ], [ @.str.20, %62 ], [ @.str.15, %65 ], [ @.str.15, %74 ], [ @.str.15, %78 ], [ @.str.20, %82 ], [ @.str.15, %85 ], [ @.str.20, %93 ], [ @.str.28, %96 ], [ @.str.29, %100 ]
  %.0 = phi i32 [ %9, %2 ], [ %12, %10 ], [ %15, %13 ], [ %18, %16 ], [ %22, %19 ], [ %31, %23 ], [ %35, %32 ], [ %39, %36 ], [ %43, %40 ], [ %46, %44 ], [ %54, %47 ], [ %57, %55 ], [ %61, %58 ], [ %64, %62 ], [ %73, %65 ], [ %77, %74 ], [ %81, %78 ], [ %84, %82 ], [ %92, %85 ], [ %95, %93 ], [ %99, %96 ], [ %103, %100 ]
  %105 = call ptr @mdbx_strerror(i32 noundef %.0) #5
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.018, ptr noundef %105)
  br label %107

107:                                              ; preds = %100, %104
  %.019 = phi i32 [ 1, %104 ], [ 0, %100 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 %.019
}

; 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 @unlink(ptr nocapture noundef readonly) local_unnamed_addr #2

declare i32 @mdbx_env_create(ptr noundef) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

declare void @mdbx_cursor_close(ptr noundef) local_unnamed_addr #3

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

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

declare ptr @mdbx_strerror(i32 noundef) local_unnamed_addr #3

; 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 = { "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 = { 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 #5 = { 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}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass