; LLVM IR from cruppstahl/upscaledb :: samples (env1)

; 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.ups_parameter_t = type { i32, i64 }
%struct.customer_t = type { i32, [32 x i8] }
%struct.order_t = type { i32, i32, [32 x i8] }
%struct.ups_key_t = type { i16, ptr, i32, i32 }
%struct.ups_record_t = type { i32, ptr, i32 }

@__const.main.params = external hidden unnamed_addr constant [2 x %struct.ups_parameter_t], align 16
@__const.main.customers = external hidden unnamed_addr constant [4 x %struct.customer_t], align 16
@__const.main.orders = external hidden unnamed_addr constant [8 x %struct.order_t], align 16
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [2 x ptr], align 16
  %9 = alloca ptr, align 8
  %10 = alloca [2 x ptr], align 16
  %11 = alloca %struct.ups_key_t, align 8
  %12 = alloca %struct.ups_key_t, align 8
  %13 = alloca %struct.ups_key_t, align 8
  %14 = alloca %struct.ups_record_t, align 8
  %15 = alloca %struct.ups_record_t, align 8
  %16 = alloca %struct.ups_record_t, align 8
  %17 = alloca [2 x %struct.ups_parameter_t], align 16
  %18 = alloca [4 x %struct.customer_t], align 16
  %19 = alloca [8 x %struct.order_t], align 16
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 @__const.main.params, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 144, ptr %18) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 @__const.main.customers, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 320, ptr %19) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 @__const.main.orders, i64 320, i1 false)
  %23 = call i32 @ups_env_create(ptr noundef %9, ptr noundef @.str.1, i32 noundef 0, i32 noundef 436, ptr noundef null)
  store i32 %23, ptr %7, align 4, !tbaa !5
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %2
  %27 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.2, i32 noundef %27)
  br label %28

28:                                               ; preds = %26, %2
  %29 = load ptr, ptr %9, align 8, !tbaa !9
  %30 = getelementptr inbounds [2 x ptr], ptr %8, i64 0, i64 0
  %31 = getelementptr inbounds [2 x %struct.ups_parameter_t], ptr %17, i64 0, i64 0
  %32 = call i32 @ups_env_create_db(ptr noundef %29, ptr noundef %30, i16 noundef zeroext 1, i32 noundef 0, ptr noundef %31)
  store i32 %32, ptr %7, align 4, !tbaa !5
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %28
  %36 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.3, i32 noundef %36)
  br label %37

37:                                               ; preds = %35, %28
  %38 = load ptr, ptr %9, align 8, !tbaa !9
  %39 = getelementptr inbounds [2 x ptr], ptr %8, i64 0, i64 1
  %40 = getelementptr inbounds [2 x %struct.ups_parameter_t], ptr %17, i64 0, i64 0
  %41 = call i32 @ups_env_create_db(ptr noundef %38, ptr noundef %39, i16 noundef zeroext 2, i32 noundef 0, ptr noundef %40)
  store i32 %41, ptr %7, align 4, !tbaa !5
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %37
  %45 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.4, i32 noundef %45)
  br label %46

46:                                               ; preds = %44, %37
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %65, %46
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = icmp slt i32 %48, 2
  br i1 %49, label %50, label %68

50:                                               ; preds = %47
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 %52
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [2 x ptr], ptr %8, i64 0, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = call i32 @ups_cursor_create(ptr noundef %53, ptr noundef %57, ptr noundef null, i32 noundef 0)
  store i32 %58, ptr %7, align 4, !tbaa !5
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %50
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %62)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %278

64:                                               ; preds = %50
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %6, align 4, !tbaa !5
  br label %47, !llvm.loop !11

68:                                               ; preds = %47
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %92, %68
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = icmp slt i32 %70, 4
  br i1 %71, label %72, label %95

72:                                               ; preds = %69
  %73 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 0
  store i16 4, ptr %73, align 8, !tbaa !13
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [4 x %struct.customer_t], ptr %18, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.customer_t, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 1
  store ptr %77, ptr %78, align 8, !tbaa !16
  %79 = getelementptr inbounds %struct.ups_record_t, ptr %14, i32 0, i32 0
  store i32 36, ptr %79, align 8, !tbaa !17
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [4 x %struct.customer_t], ptr %18, i64 0, i64 %81
  %83 = getelementptr inbounds %struct.ups_record_t, ptr %14, i32 0, i32 1
  store ptr %82, ptr %83, align 8, !tbaa !19
  %84 = getelementptr inbounds [2 x ptr], ptr %8, i64 0, i64 0
  %85 = load ptr, ptr %84, align 16, !tbaa !9
  %86 = call i32 @ups_db_insert(ptr noundef %85, ptr noundef null, ptr noundef %11, ptr noundef %14, i32 noundef 0)
  store i32 %86, ptr %7, align 4, !tbaa !5
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %91

89:                                               ; preds = %72
  %90 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.6, i32 noundef %90)
  br label %91

91:                                               ; preds = %89, %72
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %6, align 4, !tbaa !5
  br label %69, !llvm.loop !20

95:                                               ; preds = %69
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %119, %95
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = icmp slt i32 %97, 8
  br i1 %98, label %99, label %122

99:                                               ; preds = %96
  %100 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 0
  store i16 4, ptr %100, align 8, !tbaa !13
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [8 x %struct.order_t], ptr %19, i64 0, i64 %102
  %104 = getelementptr inbounds %struct.order_t, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 1
  store ptr %104, ptr %105, align 8, !tbaa !16
  %106 = getelementptr inbounds %struct.ups_record_t, ptr %14, i32 0, i32 0
  store i32 40, ptr %106, align 8, !tbaa !17
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [8 x %struct.order_t], ptr %19, i64 0, i64 %108
  %110 = getelementptr inbounds %struct.ups_record_t, ptr %14, i32 0, i32 1
  store ptr %109, ptr %110, align 8, !tbaa !19
  %111 = getelementptr inbounds [2 x ptr], ptr %8, i64 0, i64 1
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = call i32 @ups_db_insert(ptr noundef %112, ptr noundef null, ptr noundef %11, ptr noundef %14, i32 noundef 0)
  store i32 %113, ptr %7, align 4, !tbaa !5
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %118

116:                                              ; preds = %99
  %117 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.7, i32 noundef %117)
  br label %118

118:                                              ; preds = %116, %99
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %6, align 4, !tbaa !5
  br label %96, !llvm.loop !21

122:                                              ; preds = %96
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %137, %122
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = icmp slt i32 %124, 2
  br i1 %125, label %126, label %140

126:                                              ; preds = %123
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 %128
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  %131 = call i32 @ups_cursor_close(ptr noundef %130)
  store i32 %131, ptr %7, align 4, !tbaa !5
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %136

134:                                              ; preds = %126
  %135 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.8, i32 noundef %135)
  br label %136

136:                                              ; preds = %134, %126
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %6, align 4, !tbaa !5
  br label %123, !llvm.loop !22

140:                                              ; preds = %123
  %141 = load ptr, ptr %9, align 8, !tbaa !9
  %142 = call i32 @ups_env_close(ptr noundef %141, i32 noundef 0)
  store i32 %142, ptr %7, align 4, !tbaa !5
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %147

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

147:                                              ; preds = %145, %140
  %148 = call i32 @ups_env_open(ptr noundef %9, ptr noundef @.str.1, i32 noundef 0, ptr noundef null)
  store i32 %148, ptr %7, align 4, !tbaa !5
  %149 = load i32, ptr %7, align 4, !tbaa !5
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %153

151:                                              ; preds = %147
  %152 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.10, i32 noundef %152)
  br label %153

153:                                              ; preds = %151, %147
  %154 = load ptr, ptr %9, align 8, !tbaa !9
  %155 = getelementptr inbounds [2 x ptr], ptr %8, i64 0, i64 0
  %156 = call i32 @ups_env_open_db(ptr noundef %154, ptr noundef %155, i16 noundef zeroext 1, i32 noundef 0, ptr noundef null)
  store i32 %156, ptr %7, align 4, !tbaa !5
  %157 = load i32, ptr %7, align 4, !tbaa !5
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %161

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

161:                                              ; preds = %159, %153
  %162 = load ptr, ptr %9, align 8, !tbaa !9
  %163 = getelementptr inbounds [2 x ptr], ptr %8, i64 0, i64 1
  %164 = call i32 @ups_env_open_db(ptr noundef %162, ptr noundef %163, i16 noundef zeroext 2, i32 noundef 0, ptr noundef null)
  store i32 %164, ptr %7, align 4, !tbaa !5
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %169

167:                                              ; preds = %161
  %168 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.12, i32 noundef %168)
  br label %169

169:                                              ; preds = %167, %161
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %188, %169
  %171 = load i32, ptr %6, align 4, !tbaa !5
  %172 = icmp slt i32 %171, 2
  br i1 %172, label %173, label %191

173:                                              ; preds = %170
  %174 = load i32, ptr %6, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 %175
  %177 = load i32, ptr %6, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [2 x ptr], ptr %8, i64 0, i64 %178
  %180 = load ptr, ptr %179, align 8, !tbaa !9
  %181 = call i32 @ups_cursor_create(ptr noundef %176, ptr noundef %180, ptr noundef null, i32 noundef 0)
  store i32 %181, ptr %7, align 4, !tbaa !5
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %187

184:                                              ; preds = %173
  %185 = load i32, ptr %7, align 4, !tbaa !5
  %186 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %185)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %278

187:                                              ; preds = %173
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %6, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %6, align 4, !tbaa !5
  br label %170, !llvm.loop !23

191:                                              ; preds = %170
  br label %192

192:                                              ; preds = %268, %266, %191
  br label %193

193:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %194 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  %195 = load ptr, ptr %194, align 16, !tbaa !9
  %196 = call i32 @ups_cursor_move(ptr noundef %195, ptr noundef %12, ptr noundef %15, i32 noundef 4)
  store i32 %196, ptr %7, align 4, !tbaa !5
  %197 = load i32, ptr %7, align 4, !tbaa !5
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %199, label %206

199:                                              ; preds = %193
  %200 = load i32, ptr %7, align 4, !tbaa !5
  %201 = icmp eq i32 %200, -11
  br i1 %201, label %202, label %203

202:                                              ; preds = %199
  store i32 18, ptr %20, align 4
  br label %266

203:                                              ; preds = %199
  %204 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.13, i32 noundef %204)
  br label %205

205:                                              ; preds = %203
  br label %206

206:                                              ; preds = %205, %193
  %207 = getelementptr inbounds %struct.ups_record_t, ptr %15, i32 0, i32 1
  %208 = load ptr, ptr %207, align 8, !tbaa !19
  store ptr %208, ptr %21, align 8, !tbaa !9
  %209 = load ptr, ptr %21, align 8, !tbaa !9
  %210 = getelementptr inbounds %struct.customer_t, ptr %209, i32 0, i32 0
  %211 = load i32, ptr %210, align 4, !tbaa !24
  %212 = load ptr, ptr %21, align 8, !tbaa !9
  %213 = getelementptr inbounds %struct.customer_t, ptr %212, i32 0, i32 1
  %214 = getelementptr inbounds [32 x i8], ptr %213, i64 0, i64 0
  %215 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %211, ptr noundef %214)
  %216 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  %217 = load ptr, ptr %216, align 8, !tbaa !9
  %218 = call i32 @ups_cursor_move(ptr noundef %217, ptr noundef %13, ptr noundef %16, i32 noundef 1)
  store i32 %218, ptr %7, align 4, !tbaa !5
  %219 = load i32, ptr %7, align 4, !tbaa !5
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %221, label %228

221:                                              ; preds = %206
  %222 = load i32, ptr %7, align 4, !tbaa !5
  %223 = icmp eq i32 %222, -11
  br i1 %223, label %224, label %225

224:                                              ; preds = %221
  store i32 17, ptr %20, align 4
  br label %266

225:                                              ; preds = %221
  %226 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.15, i32 noundef %226)
  br label %227

227:                                              ; preds = %225
  br label %228

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

229:                                              ; preds = %264, %228
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %230 = getelementptr inbounds %struct.ups_record_t, ptr %16, i32 0, i32 1
  %231 = load ptr, ptr %230, align 8, !tbaa !19
  store ptr %231, ptr %22, align 8, !tbaa !9
  %232 = load ptr, ptr %22, align 8, !tbaa !9
  %233 = getelementptr inbounds %struct.order_t, ptr %232, i32 0, i32 1
  %234 = load i32, ptr %233, align 4, !tbaa !26
  %235 = load ptr, ptr %21, align 8, !tbaa !9
  %236 = getelementptr inbounds %struct.customer_t, ptr %235, i32 0, i32 0
  %237 = load i32, ptr %236, align 4, !tbaa !24
  %238 = icmp eq i32 %234, %237
  br i1 %238, label %239, label %247

239:                                              ; preds = %229
  %240 = load ptr, ptr %22, align 8, !tbaa !9
  %241 = getelementptr inbounds %struct.order_t, ptr %240, i32 0, i32 0
  %242 = load i32, ptr %241, align 4, !tbaa !28
  %243 = load ptr, ptr %22, align 8, !tbaa !9
  %244 = getelementptr inbounds %struct.order_t, ptr %243, i32 0, i32 2
  %245 = getelementptr inbounds [32 x i8], ptr %244, i64 0, i64 0
  %246 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %242, ptr noundef %245)
  br label %247

247:                                              ; preds = %239, %229
  %248 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  %249 = load ptr, ptr %248, align 8, !tbaa !9
  %250 = call i32 @ups_cursor_move(ptr noundef %249, ptr noundef %13, ptr noundef %16, i32 noundef 4)
  store i32 %250, ptr %7, align 4, !tbaa !5
  %251 = load i32, ptr %7, align 4, !tbaa !5
  %252 = icmp ne i32 %251, 0
  br i1 %252, label %253, label %260

253:                                              ; preds = %247
  %254 = load i32, ptr %7, align 4, !tbaa !5
  %255 = icmp eq i32 %254, -11
  br i1 %255, label %256, label %257

256:                                              ; preds = %253
  store i32 19, ptr %20, align 4
  br label %261

257:                                              ; preds = %253
  %258 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.15, i32 noundef %258)
  br label %259

259:                                              ; preds = %257
  br label %260

260:                                              ; preds = %259, %247
  store i32 0, ptr %20, align 4
  br label %261

261:                                              ; preds = %260, %256
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %262 = load i32, ptr %20, align 4
  switch i32 %262, label %280 [
    i32 0, label %263
    i32 19, label %265
  ]

263:                                              ; preds = %261
  br label %264

264:                                              ; preds = %263
  br i1 true, label %229, label %265

265:                                              ; preds = %264, %261
  store i32 0, ptr %20, align 4
  br label %266

266:                                              ; preds = %265, %224, %202
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  %267 = load i32, ptr %20, align 4
  switch i32 %267, label %280 [
    i32 0, label %268
    i32 18, label %269
    i32 17, label %192
  ]

268:                                              ; preds = %266
  br label %192

269:                                              ; preds = %266
  %270 = load ptr, ptr %9, align 8, !tbaa !9
  %271 = call i32 @ups_env_close(ptr noundef %270, i32 noundef 1)
  store i32 %271, ptr %7, align 4, !tbaa !5
  %272 = load i32, ptr %7, align 4, !tbaa !5
  %273 = icmp ne i32 %272, 0
  br i1 %273, label %274, label %276

274:                                              ; preds = %269
  %275 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.9, i32 noundef %275)
  br label %276

276:                                              ; preds = %274, %269
  %277 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %278

278:                                              ; preds = %276, %184, %61
  call void @llvm.lifetime.end.p0(i64 320, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %279 = load i32, ptr %3, align 4
  ret i32 %279

280:                                              ; preds = %266, %261
  unreachable
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare i32 @ups_env_create(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

declare i32 @ups_env_create_db(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef, ptr noundef) #1

declare i32 @ups_cursor_create(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare i32 @ups_db_insert(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare i32 @ups_cursor_close(ptr noundef) #1

declare i32 @ups_env_close(ptr noundef, i32 noundef) #1

declare i32 @ups_env_open(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

declare i32 @ups_env_open_db(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef, ptr noundef) #1

declare i32 @ups_cursor_move(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !10, i64 8, !6, i64 16, !6, i64 20}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !10, i64 8}
!17 = !{!18, !6, i64 0}
!18 = !{!"", !6, i64 0, !10, i64 8, !6, i64 16}
!19 = !{!18, !10, i64 8}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = !{!25, !6, i64 0}
!25 = !{!"", !6, i64 0, !7, i64 4}
!26 = !{!27, !6, i64 4}
!27 = !{!"", !6, i64 0, !6, i64 4, !7, i64 8}
!28 = !{!27, !6, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ups_parameter_t = type { i32, i64 }
%struct.customer_t = type { i32, [32 x i8] }
%struct.order_t = type { i32, i32, [32 x i8] }
%struct.ups_key_t = type { i16, ptr, i32, i32 }
%struct.ups_record_t = type { i32, ptr, i32 }

@__const.main.params = external hidden unnamed_addr constant [2 x %struct.ups_parameter_t], align 16
@__const.main.customers = external hidden unnamed_addr constant [4 x %struct.customer_t], align 16
@__const.main.orders = external hidden unnamed_addr constant [8 x %struct.order_t], align 16
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [2 x ptr], align 16
  %4 = alloca ptr, align 8
  %5 = alloca [2 x ptr], align 16
  %6 = alloca %struct.ups_key_t, align 8
  %7 = alloca %struct.ups_key_t, align 8
  %8 = alloca %struct.ups_key_t, align 8
  %9 = alloca %struct.ups_record_t, align 8
  %10 = alloca %struct.ups_record_t, align 8
  %11 = alloca %struct.ups_record_t, align 8
  %12 = alloca [2 x %struct.ups_parameter_t], align 16
  %13 = alloca [4 x %struct.customer_t], align 16
  %14 = alloca [8 x %struct.order_t], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %8, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %10, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %12, ptr noundef nonnull align 16 dereferenceable(32) @__const.main.params, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %13) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) %13, ptr noundef nonnull align 16 dereferenceable(144) @__const.main.customers, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 320, ptr nonnull %14) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(320) %14, ptr noundef nonnull align 16 dereferenceable(320) @__const.main.orders, i64 320, i1 false)
  %15 = call i32 @ups_env_create(ptr noundef nonnull %4, ptr noundef nonnull @.str.1, i32 noundef 0, i32 noundef 436, ptr noundef null) #6
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %17, label %16

16:                                               ; preds = %2
  call void @error(ptr noundef nonnull @.str.2, i32 noundef %15)
  br label %17

17:                                               ; preds = %16, %2
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call i32 @ups_env_create_db(ptr noundef %18, ptr noundef nonnull %3, i16 noundef zeroext 1, i32 noundef 0, ptr noundef nonnull %12) #6
  %.not81 = icmp eq i32 %19, 0
  br i1 %.not81, label %21, label %20

20:                                               ; preds = %17
  call void @error(ptr noundef nonnull @.str.3, i32 noundef %19)
  br label %21

21:                                               ; preds = %20, %17
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %3, i64 8
  %24 = call i32 @ups_env_create_db(ptr noundef %22, ptr noundef nonnull %23, i16 noundef zeroext 2, i32 noundef 0, ptr noundef nonnull %12) #6
  %.not82 = icmp eq i32 %24, 0
  br i1 %.not82, label %26, label %25

25:                                               ; preds = %21
  call void @error(ptr noundef nonnull @.str.4, i32 noundef %24)
  br label %26

26:                                               ; preds = %25, %21
  %27 = load ptr, ptr %3, align 16, !tbaa !5
  %28 = call i32 @ups_cursor_create(ptr noundef nonnull %5, ptr noundef %27, ptr noundef null, i32 noundef 0) #6
  %.not95 = icmp eq i32 %28, 0
  br i1 %.not95, label %29, label %37

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %5, i64 8
  %31 = load ptr, ptr %23, align 8, !tbaa !5
  %32 = call i32 @ups_cursor_create(ptr noundef nonnull %30, ptr noundef %31, ptr noundef null, i32 noundef 0) #6
  %.not95.1 = icmp eq i32 %32, 0
  br i1 %.not95.1, label %.preheader106, label %37

.preheader106:                                    ; preds = %29
  %33 = getelementptr inbounds i8, ptr %6, i64 8
  %34 = getelementptr inbounds i8, ptr %9, i64 8
  store i16 4, ptr %6, align 8, !tbaa !9
  store ptr %13, ptr %33, align 8, !tbaa !13
  store i32 36, ptr %9, align 8, !tbaa !14
  store ptr %13, ptr %34, align 8, !tbaa !16
  %35 = load ptr, ptr %3, align 16, !tbaa !5
  %36 = call i32 @ups_db_insert(ptr noundef %35, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not94 = icmp eq i32 %36, 0
  br i1 %.not94, label %40, label %39

37:                                               ; preds = %29, %26
  %.lcssa114 = phi i32 [ %28, %26 ], [ %32, %29 ]
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %.lcssa114)
  br label %153

39:                                               ; preds = %.preheader106
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %36)
  br label %40

40:                                               ; preds = %.preheader106, %39
  store i16 4, ptr %6, align 8, !tbaa !9
  %41 = getelementptr inbounds i8, ptr %13, i64 36
  store ptr %41, ptr %33, align 8, !tbaa !13
  store i32 36, ptr %9, align 8, !tbaa !14
  store ptr %41, ptr %34, align 8, !tbaa !16
  %42 = load ptr, ptr %3, align 16, !tbaa !5
  %43 = call i32 @ups_db_insert(ptr noundef %42, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not94.1 = icmp eq i32 %43, 0
  br i1 %.not94.1, label %45, label %44

44:                                               ; preds = %40
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %43)
  br label %45

45:                                               ; preds = %44, %40
  store i16 4, ptr %6, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %13, i64 72
  store ptr %46, ptr %33, align 8, !tbaa !13
  store i32 36, ptr %9, align 8, !tbaa !14
  store ptr %46, ptr %34, align 8, !tbaa !16
  %47 = load ptr, ptr %3, align 16, !tbaa !5
  %48 = call i32 @ups_db_insert(ptr noundef %47, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not94.2 = icmp eq i32 %48, 0
  br i1 %.not94.2, label %50, label %49

49:                                               ; preds = %45
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %48)
  br label %50

50:                                               ; preds = %49, %45
  store i16 4, ptr %6, align 8, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %13, i64 108
  store ptr %51, ptr %33, align 8, !tbaa !13
  store i32 36, ptr %9, align 8, !tbaa !14
  store ptr %51, ptr %34, align 8, !tbaa !16
  %52 = load ptr, ptr %3, align 16, !tbaa !5
  %53 = call i32 @ups_db_insert(ptr noundef %52, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not94.3 = icmp eq i32 %53, 0
  br i1 %.not94.3, label %.preheader105, label %54

54:                                               ; preds = %50
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %53)
  br label %.preheader105

.preheader105:                                    ; preds = %54, %50
  store i16 4, ptr %6, align 8, !tbaa !9
  store ptr %14, ptr %33, align 8, !tbaa !13
  store i32 40, ptr %9, align 8, !tbaa !14
  store ptr %14, ptr %34, align 8, !tbaa !16
  %55 = load ptr, ptr %23, align 8, !tbaa !5
  %56 = call i32 @ups_db_insert(ptr noundef %55, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not93 = icmp eq i32 %56, 0
  br i1 %.not93, label %58, label %57

57:                                               ; preds = %.preheader105
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %56)
  br label %58

58:                                               ; preds = %.preheader105, %57
  store i16 4, ptr %6, align 8, !tbaa !9
  %59 = getelementptr inbounds i8, ptr %14, i64 40
  store ptr %59, ptr %33, align 8, !tbaa !13
  store i32 40, ptr %9, align 8, !tbaa !14
  store ptr %59, ptr %34, align 8, !tbaa !16
  %60 = load ptr, ptr %23, align 8, !tbaa !5
  %61 = call i32 @ups_db_insert(ptr noundef %60, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not93.1 = icmp eq i32 %61, 0
  br i1 %.not93.1, label %63, label %62

62:                                               ; preds = %58
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %61)
  br label %63

63:                                               ; preds = %62, %58
  store i16 4, ptr %6, align 8, !tbaa !9
  %64 = getelementptr inbounds i8, ptr %14, i64 80
  store ptr %64, ptr %33, align 8, !tbaa !13
  store i32 40, ptr %9, align 8, !tbaa !14
  store ptr %64, ptr %34, align 8, !tbaa !16
  %65 = load ptr, ptr %23, align 8, !tbaa !5
  %66 = call i32 @ups_db_insert(ptr noundef %65, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not93.2 = icmp eq i32 %66, 0
  br i1 %.not93.2, label %68, label %67

67:                                               ; preds = %63
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %66)
  br label %68

68:                                               ; preds = %67, %63
  store i16 4, ptr %6, align 8, !tbaa !9
  %69 = getelementptr inbounds i8, ptr %14, i64 120
  store ptr %69, ptr %33, align 8, !tbaa !13
  store i32 40, ptr %9, align 8, !tbaa !14
  store ptr %69, ptr %34, align 8, !tbaa !16
  %70 = load ptr, ptr %23, align 8, !tbaa !5
  %71 = call i32 @ups_db_insert(ptr noundef %70, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not93.3 = icmp eq i32 %71, 0
  br i1 %.not93.3, label %73, label %72

72:                                               ; preds = %68
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %71)
  br label %73

73:                                               ; preds = %72, %68
  store i16 4, ptr %6, align 8, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %14, i64 160
  store ptr %74, ptr %33, align 8, !tbaa !13
  store i32 40, ptr %9, align 8, !tbaa !14
  store ptr %74, ptr %34, align 8, !tbaa !16
  %75 = load ptr, ptr %23, align 8, !tbaa !5
  %76 = call i32 @ups_db_insert(ptr noundef %75, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not93.4 = icmp eq i32 %76, 0
  br i1 %.not93.4, label %78, label %77

77:                                               ; preds = %73
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %76)
  br label %78

78:                                               ; preds = %77, %73
  store i16 4, ptr %6, align 8, !tbaa !9
  %79 = getelementptr inbounds i8, ptr %14, i64 200
  store ptr %79, ptr %33, align 8, !tbaa !13
  store i32 40, ptr %9, align 8, !tbaa !14
  store ptr %79, ptr %34, align 8, !tbaa !16
  %80 = load ptr, ptr %23, align 8, !tbaa !5
  %81 = call i32 @ups_db_insert(ptr noundef %80, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not93.5 = icmp eq i32 %81, 0
  br i1 %.not93.5, label %83, label %82

82:                                               ; preds = %78
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %81)
  br label %83

83:                                               ; preds = %82, %78
  store i16 4, ptr %6, align 8, !tbaa !9
  %84 = getelementptr inbounds i8, ptr %14, i64 240
  store ptr %84, ptr %33, align 8, !tbaa !13
  store i32 40, ptr %9, align 8, !tbaa !14
  store ptr %84, ptr %34, align 8, !tbaa !16
  %85 = load ptr, ptr %23, align 8, !tbaa !5
  %86 = call i32 @ups_db_insert(ptr noundef %85, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not93.6 = icmp eq i32 %86, 0
  br i1 %.not93.6, label %88, label %87

87:                                               ; preds = %83
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %86)
  br label %88

88:                                               ; preds = %87, %83
  store i16 4, ptr %6, align 8, !tbaa !9
  %89 = getelementptr inbounds i8, ptr %14, i64 280
  store ptr %89, ptr %33, align 8, !tbaa !13
  store i32 40, ptr %9, align 8, !tbaa !14
  store ptr %89, ptr %34, align 8, !tbaa !16
  %90 = load ptr, ptr %23, align 8, !tbaa !5
  %91 = call i32 @ups_db_insert(ptr noundef %90, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %9, i32 noundef 0) #6
  %.not93.7 = icmp eq i32 %91, 0
  br i1 %.not93.7, label %.preheader104.preheader, label %92

92:                                               ; preds = %88
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %91)
  br label %.preheader104.preheader

.preheader104.preheader:                          ; preds = %92, %88
  %93 = load ptr, ptr %5, align 16, !tbaa !5
  %94 = call i32 @ups_cursor_close(ptr noundef %93) #6
  %.not92 = icmp eq i32 %94, 0
  br i1 %.not92, label %.preheader104.1, label %95

95:                                               ; preds = %.preheader104.preheader
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %94)
  br label %.preheader104.1

.preheader104.1:                                  ; preds = %.preheader104.preheader, %95
  %96 = load ptr, ptr %30, align 8, !tbaa !5
  %97 = call i32 @ups_cursor_close(ptr noundef %96) #6
  %.not92.1 = icmp eq i32 %97, 0
  br i1 %.not92.1, label %99, label %98

98:                                               ; preds = %.preheader104.1
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %97)
  br label %99

99:                                               ; preds = %98, %.preheader104.1
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = call i32 @ups_env_close(ptr noundef %100, i32 noundef 0) #6
  %.not83 = icmp eq i32 %101, 0
  br i1 %.not83, label %103, label %102

102:                                              ; preds = %99
  call void @error(ptr noundef nonnull @.str.9, i32 noundef %101)
  br label %103

103:                                              ; preds = %102, %99
  %104 = call i32 @ups_env_open(ptr noundef nonnull %4, ptr noundef nonnull @.str.1, i32 noundef 0, ptr noundef null) #6
  %.not84 = icmp eq i32 %104, 0
  br i1 %.not84, label %106, label %105

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

106:                                              ; preds = %105, %103
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = call i32 @ups_env_open_db(ptr noundef %107, ptr noundef nonnull %3, i16 noundef zeroext 1, i32 noundef 0, ptr noundef null) #6
  %.not85 = icmp eq i32 %108, 0
  br i1 %.not85, label %110, label %109

109:                                              ; preds = %106
  call void @error(ptr noundef nonnull @.str.11, i32 noundef %108)
  br label %110

110:                                              ; preds = %109, %106
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = call i32 @ups_env_open_db(ptr noundef %111, ptr noundef nonnull %23, i16 noundef zeroext 2, i32 noundef 0, ptr noundef null) #6
  %.not86 = icmp eq i32 %112, 0
  br i1 %.not86, label %114, label %113

113:                                              ; preds = %110
  call void @error(ptr noundef nonnull @.str.12, i32 noundef %112)
  br label %114

114:                                              ; preds = %113, %110
  %115 = load ptr, ptr %3, align 16, !tbaa !5
  %116 = call i32 @ups_cursor_create(ptr noundef nonnull %5, ptr noundef %115, ptr noundef null, i32 noundef 0) #6
  %.not91 = icmp eq i32 %116, 0
  br i1 %.not91, label %117, label %122

117:                                              ; preds = %114
  %118 = load ptr, ptr %23, align 8, !tbaa !5
  %119 = call i32 @ups_cursor_create(ptr noundef nonnull %30, ptr noundef %118, ptr noundef null, i32 noundef 0) #6
  %.not91.1 = icmp eq i32 %119, 0
  br i1 %.not91.1, label %.preheader, label %122

.preheader:                                       ; preds = %117
  %120 = getelementptr inbounds i8, ptr %10, i64 8
  %121 = getelementptr inbounds i8, ptr %11, i64 8
  br label %.thread

122:                                              ; preds = %117, %114
  %.lcssa = phi i32 [ %116, %114 ], [ %119, %117 ]
  %123 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %.lcssa)
  br label %153

.thread:                                          ; preds = %.thread.backedge, %.preheader
  %124 = load ptr, ptr %5, align 16, !tbaa !5
  %125 = call i32 @ups_cursor_move(ptr noundef %124, ptr noundef nonnull %7, ptr noundef nonnull %10, i32 noundef 4) #6
  switch i32 %125, label %126 [
    i32 0, label %127
    i32 -11, label %147
  ]

126:                                              ; preds = %.thread
  call void @error(ptr noundef nonnull @.str.13, i32 noundef %125)
  br label %127

127:                                              ; preds = %.thread, %126
  %128 = load ptr, ptr %120, align 8, !tbaa !16
  %129 = load i32, ptr %128, align 4, !tbaa !17
  %130 = getelementptr inbounds i8, ptr %128, i64 4
  %131 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %129, ptr noundef nonnull %130)
  %132 = load ptr, ptr %30, align 8, !tbaa !5
  %133 = call i32 @ups_cursor_move(ptr noundef %132, ptr noundef nonnull %8, ptr noundef nonnull %11, i32 noundef 1) #6
  switch i32 %133, label %.sink.split [
    i32 0, label %.preheader121
    i32 -11, label %.thread.backedge
  ]

.thread.backedge:                                 ; preds = %144, %127
  br label %.thread

.sink.split:                                      ; preds = %144, %127
  %.sink = phi i32 [ %133, %127 ], [ %146, %144 ]
  call void @error(ptr noundef nonnull @.str.15, i32 noundef %.sink)
  br label %.preheader121

.preheader121:                                    ; preds = %127, %.sink.split
  br label %134

134:                                              ; preds = %.preheader121, %144
  %135 = load ptr, ptr %121, align 8, !tbaa !16
  %136 = getelementptr inbounds i8, ptr %135, i64 4
  %137 = load i32, ptr %136, align 4, !tbaa !19
  %138 = load i32, ptr %128, align 4, !tbaa !17
  %139 = icmp eq i32 %137, %138
  br i1 %139, label %140, label %144

140:                                              ; preds = %134
  %141 = load i32, ptr %135, align 4, !tbaa !21
  %142 = getelementptr inbounds i8, ptr %135, i64 8
  %143 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef %141, ptr noundef nonnull %142)
  br label %144

144:                                              ; preds = %140, %134
  %145 = load ptr, ptr %30, align 8, !tbaa !5
  %146 = call i32 @ups_cursor_move(ptr noundef %145, ptr noundef nonnull %8, ptr noundef nonnull %11, i32 noundef 4) #6
  switch i32 %146, label %.sink.split [
    i32 0, label %134
    i32 -11, label %.thread.backedge
  ]

147:                                              ; preds = %.thread
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = call i32 @ups_env_close(ptr noundef %148, i32 noundef 1) #6
  %.not90 = icmp eq i32 %149, 0
  br i1 %.not90, label %151, label %150

150:                                              ; preds = %147
  call void @error(ptr noundef nonnull @.str.9, i32 noundef %149)
  br label %151

151:                                              ; preds = %150, %147
  %152 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  br label %153

153:                                              ; preds = %151, %122, %37
  %.0 = phi i32 [ -1, %37 ], [ -1, %122 ], [ 0, %151 ]
  call void @llvm.lifetime.end.p0(i64 320, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, 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) #2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

declare i32 @ups_env_create_db(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef, ptr noundef) local_unnamed_addr #5

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

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

declare i32 @ups_cursor_close(ptr noundef) local_unnamed_addr #5

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

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

declare i32 @ups_env_open_db(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef, ptr noundef) local_unnamed_addr #5

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !6, i64 8, !12, i64 16, !12, i64 20}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !12, i64 0}
!15 = !{!"", !12, i64 0, !6, i64 8, !12, i64 16}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !12, i64 0}
!18 = !{!"", !12, i64 0, !7, i64 4}
!19 = !{!20, !12, i64 4}
!20 = !{!"", !12, i64 0, !12, i64 4, !7, i64 8}
!21 = !{!20, !12, i64 0}


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