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

; 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 [28 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.18 = 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 [3 x ptr], align 16
  %9 = alloca ptr, align 8
  %10 = alloca [3 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_key_t, align 8
  %15 = alloca %struct.ups_record_t, align 8
  %16 = alloca %struct.ups_record_t, align 8
  %17 = alloca %struct.ups_record_t, align 8
  %18 = alloca %struct.ups_record_t, align 8
  %19 = alloca [2 x %struct.ups_parameter_t], align 16
  %20 = alloca [3 x %struct.ups_parameter_t], align 16
  %21 = alloca [4 x %struct.customer_t], align 16
  %22 = alloca [8 x %struct.order_t], align 16
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 24, 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 24, ptr %17) #5
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #5
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 @__const.main.params, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 48, ptr %20) #5
  call void @llvm.memset.p0.i64(ptr align 16 %20, i8 0, i64 48, i1 false)
  %26 = getelementptr inbounds [3 x %struct.ups_parameter_t], ptr %20, i32 0, i32 0
  %27 = getelementptr inbounds %struct.ups_parameter_t, ptr %26, i32 0, i32 0
  store i32 260, ptr %27, align 16
  %28 = getelementptr inbounds %struct.ups_parameter_t, ptr %26, i32 0, i32 1
  store i64 7, ptr %28, align 8
  %29 = getelementptr inbounds [3 x %struct.ups_parameter_t], ptr %20, i32 0, i32 1
  %30 = getelementptr inbounds %struct.ups_parameter_t, ptr %29, i32 0, i32 0
  store i32 264, ptr %30, align 16
  %31 = getelementptr inbounds %struct.ups_parameter_t, ptr %29, i32 0, i32 1
  store i64 4, ptr %31, align 8
  call void @llvm.lifetime.start.p0(i64 144, ptr %21) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 @__const.main.customers, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 320, ptr %22) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 @__const.main.orders, i64 320, i1 false)
  %32 = call i32 @ups_env_create(ptr noundef %9, ptr noundef @.str.1, i32 noundef 0, i32 noundef 436, ptr noundef null)
  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 = %2
  %36 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.2, i32 noundef %36)
  br label %37

37:                                               ; preds = %35, %2
  %38 = load ptr, ptr %9, align 8, !tbaa !9
  %39 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 0
  %40 = getelementptr inbounds [2 x %struct.ups_parameter_t], ptr %19, i64 0, i64 0
  %41 = call i32 @ups_env_create_db(ptr noundef %38, ptr noundef %39, i16 noundef zeroext 1, 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.3, i32 noundef %45)
  br label %46

46:                                               ; preds = %44, %37
  %47 = load ptr, ptr %9, align 8, !tbaa !9
  %48 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 1
  %49 = getelementptr inbounds [2 x %struct.ups_parameter_t], ptr %19, i64 0, i64 0
  %50 = call i32 @ups_env_create_db(ptr noundef %47, ptr noundef %48, i16 noundef zeroext 2, i32 noundef 0, ptr noundef %49)
  store i32 %50, ptr %7, align 4, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %55

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

55:                                               ; preds = %53, %46
  %56 = load ptr, ptr %9, align 8, !tbaa !9
  %57 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 2
  %58 = getelementptr inbounds [3 x %struct.ups_parameter_t], ptr %20, i64 0, i64 0
  %59 = call i32 @ups_env_create_db(ptr noundef %56, ptr noundef %57, i16 noundef zeroext 3, i32 noundef 16384, ptr noundef %58)
  store i32 %59, ptr %7, align 4, !tbaa !5
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %64

62:                                               ; preds = %55
  %63 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.5, i32 noundef %63)
  br label %64

64:                                               ; preds = %62, %55
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %82, %64
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = icmp slt i32 %66, 3
  br i1 %67, label %68, label %85

68:                                               ; preds = %65
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [3 x ptr], ptr %10, i64 0, i64 %70
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = call i32 @ups_cursor_create(ptr noundef %71, ptr noundef %75, ptr noundef null, i32 noundef 0)
  store i32 %76, ptr %7, align 4, !tbaa !5
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %81

79:                                               ; preds = %68
  %80 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.6, i32 noundef %80)
  br label %81

81:                                               ; preds = %79, %68
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %6, align 4, !tbaa !5
  br label %65, !llvm.loop !11

85:                                               ; preds = %65
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %109, %85
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = icmp slt i32 %87, 4
  br i1 %88, label %89, label %112

89:                                               ; preds = %86
  %90 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 0
  store i16 4, ptr %90, align 8, !tbaa !13
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4 x %struct.customer_t], ptr %21, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.customer_t, ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 1
  store ptr %94, ptr %95, align 8, !tbaa !16
  %96 = getelementptr inbounds %struct.ups_record_t, ptr %15, i32 0, i32 0
  store i32 36, ptr %96, align 8, !tbaa !17
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [4 x %struct.customer_t], ptr %21, i64 0, i64 %98
  %100 = getelementptr inbounds %struct.ups_record_t, ptr %15, i32 0, i32 1
  store ptr %99, ptr %100, align 8, !tbaa !19
  %101 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 0
  %102 = load ptr, ptr %101, align 16, !tbaa !9
  %103 = call i32 @ups_db_insert(ptr noundef %102, ptr noundef null, ptr noundef %11, ptr noundef %15, i32 noundef 0)
  store i32 %103, ptr %7, align 4, !tbaa !5
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %108

106:                                              ; preds = %89
  %107 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.7, i32 noundef %107)
  br label %108

108:                                              ; preds = %106, %89
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %6, align 4, !tbaa !5
  br label %86, !llvm.loop !20

112:                                              ; preds = %86
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %138, %112
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = icmp slt i32 %114, 8
  br i1 %115, label %116, label %141

116:                                              ; preds = %113
  %117 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 0
  store i16 4, ptr %117, align 8, !tbaa !13
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [8 x %struct.order_t], ptr %22, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.order_t, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 1
  store ptr %121, ptr %122, align 8, !tbaa !16
  %123 = getelementptr inbounds %struct.ups_record_t, ptr %15, i32 0, i32 0
  store i32 32, ptr %123, align 8, !tbaa !17
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [8 x %struct.order_t], ptr %22, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.order_t, ptr %126, i32 0, i32 2
  %128 = getelementptr inbounds [32 x i8], ptr %127, i64 0, i64 0
  %129 = getelementptr inbounds %struct.ups_record_t, ptr %15, i32 0, i32 1
  store ptr %128, ptr %129, align 8, !tbaa !19
  %130 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 1
  %131 = load ptr, ptr %130, align 8, !tbaa !9
  %132 = call i32 @ups_db_insert(ptr noundef %131, ptr noundef null, ptr noundef %11, ptr noundef %15, i32 noundef 0)
  store i32 %132, ptr %7, align 4, !tbaa !5
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %137

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

137:                                              ; preds = %135, %116
  br label %138

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

141:                                              ; preds = %113
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %166, %141
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = icmp slt i32 %143, 8
  br i1 %144, label %145, label %169

145:                                              ; preds = %142
  %146 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 0
  store i16 4, ptr %146, align 8, !tbaa !13
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [8 x %struct.order_t], ptr %22, i64 0, i64 %148
  %150 = getelementptr inbounds %struct.order_t, ptr %149, i32 0, i32 1
  %151 = getelementptr inbounds %struct.ups_key_t, ptr %11, i32 0, i32 1
  store ptr %150, ptr %151, align 8, !tbaa !16
  %152 = getelementptr inbounds %struct.ups_record_t, ptr %15, i32 0, i32 0
  store i32 4, ptr %152, align 8, !tbaa !17
  %153 = load i32, ptr %6, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [8 x %struct.order_t], ptr %22, i64 0, i64 %154
  %156 = getelementptr inbounds %struct.order_t, ptr %155, i32 0, i32 0
  %157 = getelementptr inbounds %struct.ups_record_t, ptr %15, i32 0, i32 1
  store ptr %156, ptr %157, align 8, !tbaa !19
  %158 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 2
  %159 = load ptr, ptr %158, align 16, !tbaa !9
  %160 = call i32 @ups_db_insert(ptr noundef %159, ptr noundef null, ptr noundef %11, ptr noundef %15, i32 noundef 2)
  store i32 %160, ptr %7, align 4, !tbaa !5
  %161 = load i32, ptr %7, align 4, !tbaa !5
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %163, label %165

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

165:                                              ; preds = %163, %145
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %6, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %6, align 4, !tbaa !5
  br label %142, !llvm.loop !22

169:                                              ; preds = %142
  br label %170

170:                                              ; preds = %256, %254, %169
  br label %171

171:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %172 = getelementptr inbounds [3 x ptr], ptr %10, i64 0, i64 0
  %173 = load ptr, ptr %172, align 16, !tbaa !9
  %174 = call i32 @ups_cursor_move(ptr noundef %173, ptr noundef %12, ptr noundef %16, i32 noundef 4)
  store i32 %174, ptr %7, align 4, !tbaa !5
  %175 = load i32, ptr %7, align 4, !tbaa !5
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %184

177:                                              ; preds = %171
  %178 = load i32, ptr %7, align 4, !tbaa !5
  %179 = icmp eq i32 %178, -11
  br i1 %179, label %180, label %181

180:                                              ; preds = %177
  store i32 15, ptr %24, align 4
  br label %254

181:                                              ; preds = %177
  %182 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.10, i32 noundef %182)
  br label %183

183:                                              ; preds = %181
  br label %184

184:                                              ; preds = %183, %171
  %185 = getelementptr inbounds %struct.ups_record_t, ptr %16, i32 0, i32 1
  %186 = load ptr, ptr %185, align 8, !tbaa !19
  store ptr %186, ptr %23, align 8, !tbaa !9
  %187 = load ptr, ptr %23, align 8, !tbaa !9
  %188 = getelementptr inbounds %struct.customer_t, ptr %187, i32 0, i32 0
  %189 = load i32, ptr %188, align 4, !tbaa !23
  %190 = load ptr, ptr %23, align 8, !tbaa !9
  %191 = getelementptr inbounds %struct.customer_t, ptr %190, i32 0, i32 1
  %192 = getelementptr inbounds [32 x i8], ptr %191, i64 0, i64 0
  %193 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %189, ptr noundef %192)
  %194 = load ptr, ptr %23, align 8, !tbaa !9
  %195 = getelementptr inbounds %struct.customer_t, ptr %194, i32 0, i32 0
  %196 = getelementptr inbounds %struct.ups_key_t, ptr %14, i32 0, i32 1
  store ptr %195, ptr %196, align 8, !tbaa !16
  %197 = getelementptr inbounds %struct.ups_key_t, ptr %14, i32 0, i32 0
  store i16 4, ptr %197, align 8, !tbaa !13
  %198 = getelementptr inbounds [3 x ptr], ptr %10, i64 0, i64 2
  %199 = load ptr, ptr %198, align 16, !tbaa !9
  %200 = call i32 @ups_cursor_find(ptr noundef %199, ptr noundef %14, ptr noundef null, i32 noundef 0)
  store i32 %200, ptr %7, align 4, !tbaa !5
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %209

203:                                              ; preds = %184
  %204 = load i32, ptr %7, align 4, !tbaa !5
  %205 = icmp eq i32 %204, -11
  br i1 %205, label %206, label %207

206:                                              ; preds = %203
  store i32 14, ptr %24, align 4
  br label %254

207:                                              ; preds = %203
  %208 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.12, i32 noundef %208)
  br label %209

209:                                              ; preds = %207, %184
  %210 = getelementptr inbounds [3 x ptr], ptr %10, i64 0, i64 2
  %211 = load ptr, ptr %210, align 16, !tbaa !9
  %212 = call i32 @ups_cursor_move(ptr noundef %211, ptr noundef null, ptr noundef %18, i32 noundef 0)
  store i32 %212, ptr %7, align 4, !tbaa !5
  %213 = load i32, ptr %7, align 4, !tbaa !5
  %214 = icmp ne i32 %213, 0
  br i1 %214, label %215, label %217

215:                                              ; preds = %209
  %216 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.13, i32 noundef %216)
  br label %217

217:                                              ; preds = %215, %209
  br label %218

218:                                              ; preds = %252, %217
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %219 = getelementptr inbounds %struct.ups_record_t, ptr %18, i32 0, i32 1
  %220 = load ptr, ptr %219, align 8, !tbaa !19
  %221 = load i32, ptr %220, align 4, !tbaa !5
  store i32 %221, ptr %25, align 4, !tbaa !5
  %222 = getelementptr inbounds %struct.ups_key_t, ptr %13, i32 0, i32 1
  store ptr %25, ptr %222, align 8, !tbaa !16
  %223 = getelementptr inbounds %struct.ups_key_t, ptr %13, i32 0, i32 0
  store i16 4, ptr %223, align 8, !tbaa !13
  %224 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 1
  %225 = load ptr, ptr %224, align 8, !tbaa !9
  %226 = call i32 @ups_db_find(ptr noundef %225, ptr noundef null, ptr noundef %13, ptr noundef %17, i32 noundef 0)
  store i32 %226, ptr %7, align 4, !tbaa !5
  %227 = load i32, ptr %7, align 4, !tbaa !5
  %228 = icmp ne i32 %227, 0
  br i1 %228, label %229, label %231

229:                                              ; preds = %218
  %230 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.14, i32 noundef %230)
  br label %231

231:                                              ; preds = %229, %218
  %232 = load i32, ptr %25, align 4, !tbaa !5
  %233 = getelementptr inbounds %struct.ups_record_t, ptr %17, i32 0, i32 1
  %234 = load ptr, ptr %233, align 8, !tbaa !19
  %235 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %232, ptr noundef %234)
  %236 = getelementptr inbounds [3 x ptr], ptr %10, i64 0, i64 2
  %237 = load ptr, ptr %236, align 16, !tbaa !9
  %238 = call i32 @ups_cursor_move(ptr noundef %237, ptr noundef %14, ptr noundef %18, i32 noundef 36)
  store i32 %238, ptr %7, align 4, !tbaa !5
  %239 = load i32, ptr %7, align 4, !tbaa !5
  %240 = icmp ne i32 %239, 0
  br i1 %240, label %241, label %248

241:                                              ; preds = %231
  %242 = load i32, ptr %7, align 4, !tbaa !5
  %243 = icmp eq i32 %242, -11
  br i1 %243, label %244, label %245

244:                                              ; preds = %241
  store i32 16, ptr %24, align 4
  br label %249

245:                                              ; preds = %241
  %246 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.16, i32 noundef %246)
  br label %247

247:                                              ; preds = %245
  br label %248

248:                                              ; preds = %247, %231
  store i32 0, ptr %24, align 4
  br label %249

249:                                              ; preds = %248, %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  %250 = load i32, ptr %24, align 4
  switch i32 %250, label %267 [
    i32 0, label %251
    i32 16, label %253
  ]

251:                                              ; preds = %249
  br label %252

252:                                              ; preds = %251
  br i1 true, label %218, label %253

253:                                              ; preds = %252, %249
  store i32 0, ptr %24, align 4
  br label %254

254:                                              ; preds = %253, %206, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  %255 = load i32, ptr %24, align 4
  switch i32 %255, label %267 [
    i32 0, label %256
    i32 15, label %257
    i32 14, label %170
  ]

256:                                              ; preds = %254
  br label %170

257:                                              ; preds = %254
  %258 = load ptr, ptr %9, align 8, !tbaa !9
  %259 = call i32 @ups_env_close(ptr noundef %258, i32 noundef 1)
  store i32 %259, ptr %7, align 4, !tbaa !5
  %260 = load i32, ptr %7, align 4, !tbaa !5
  %261 = icmp ne i32 %260, 0
  br i1 %261, label %262, label %264

262:                                              ; preds = %257
  %263 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.17, i32 noundef %263)
  br label %264

264:                                              ; preds = %262, %257
  %265 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 320, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 24, 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 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 24, 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
  %266 = load i32, ptr %3, align 4
  ret i32 %266

267:                                              ; preds = %254, %249
  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_move(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

declare i32 @ups_db_find(ptr noundef, 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

declare i32 @ups_env_close(ptr noundef, i32 noundef) #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 = { "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 = !{!24, !6, i64 0}
!24 = !{!"", !6, i64 0, !7, i64 4}


; 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 [28 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.18 = 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 noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [3 x ptr], align 16
  %4 = alloca ptr, align 8
  %5 = alloca [3 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_key_t, align 8
  %10 = alloca %struct.ups_record_t, align 8
  %11 = alloca %struct.ups_record_t, align 8
  %12 = alloca %struct.ups_record_t, align 8
  %13 = alloca %struct.ups_record_t, align 8
  %14 = alloca [2 x %struct.ups_parameter_t], align 16
  %15 = alloca [3 x %struct.ups_parameter_t], align 16
  %16 = alloca [4 x %struct.customer_t], align 16
  %17 = alloca [8 x %struct.order_t], align 16
  %18 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 24, 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 24, ptr nonnull %12) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %12, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %13, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %14, ptr noundef nonnull align 16 dereferenceable(32) @__const.main.params, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %15) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %15, i8 0, i64 48, i1 false)
  store i32 260, ptr %15, align 16
  %19 = getelementptr inbounds i8, ptr %15, i64 8
  store i64 7, ptr %19, align 8
  %20 = getelementptr inbounds i8, ptr %15, i64 16
  store i32 264, ptr %20, align 16
  %21 = getelementptr inbounds i8, ptr %15, i64 24
  store i64 4, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %16) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) %16, ptr noundef nonnull align 16 dereferenceable(144) @__const.main.customers, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 320, ptr nonnull %17) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(320) %17, ptr noundef nonnull align 16 dereferenceable(320) @__const.main.orders, i64 320, i1 false)
  %22 = 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 %22, 0
  br i1 %.not, label %24, label %23

23:                                               ; preds = %2
  call void @error(ptr noundef nonnull @.str.2, i32 noundef %22)
  br label %24

24:                                               ; preds = %23, %2
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call i32 @ups_env_create_db(ptr noundef %25, ptr noundef nonnull %3, i16 noundef zeroext 1, i32 noundef 0, ptr noundef nonnull %14) #6
  %.not68 = icmp eq i32 %26, 0
  br i1 %.not68, label %28, label %27

27:                                               ; preds = %24
  call void @error(ptr noundef nonnull @.str.3, i32 noundef %26)
  br label %28

28:                                               ; preds = %27, %24
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %3, i64 8
  %31 = call i32 @ups_env_create_db(ptr noundef %29, ptr noundef nonnull %30, i16 noundef zeroext 2, i32 noundef 0, ptr noundef nonnull %14) #6
  %.not69 = icmp eq i32 %31, 0
  br i1 %.not69, label %33, label %32

32:                                               ; preds = %28
  call void @error(ptr noundef nonnull @.str.4, i32 noundef %31)
  br label %33

33:                                               ; preds = %32, %28
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %3, i64 16
  %36 = call i32 @ups_env_create_db(ptr noundef %34, ptr noundef nonnull %35, i16 noundef zeroext 3, i32 noundef 16384, ptr noundef nonnull %15) #6
  %.not70 = icmp eq i32 %36, 0
  br i1 %.not70, label %38, label %37

37:                                               ; preds = %33
  call void @error(ptr noundef nonnull @.str.5, i32 noundef %36)
  br label %38

38:                                               ; preds = %37, %33
  %39 = load ptr, ptr %3, align 16, !tbaa !5
  %40 = call i32 @ups_cursor_create(ptr noundef nonnull %5, ptr noundef %39, ptr noundef null, i32 noundef 0) #6
  %.not80 = icmp eq i32 %40, 0
  br i1 %.not80, label %42, label %41

41:                                               ; preds = %38
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %40)
  br label %42

42:                                               ; preds = %38, %41
  %43 = getelementptr inbounds i8, ptr %5, i64 8
  %44 = load ptr, ptr %30, align 8, !tbaa !5
  %45 = call i32 @ups_cursor_create(ptr noundef nonnull %43, ptr noundef %44, ptr noundef null, i32 noundef 0) #6
  %.not80.1 = icmp eq i32 %45, 0
  br i1 %.not80.1, label %47, label %46

46:                                               ; preds = %42
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %45)
  br label %47

47:                                               ; preds = %46, %42
  %48 = getelementptr inbounds i8, ptr %5, i64 16
  %49 = load ptr, ptr %35, align 16, !tbaa !5
  %50 = call i32 @ups_cursor_create(ptr noundef nonnull %48, ptr noundef %49, ptr noundef null, i32 noundef 0) #6
  %.not80.2 = icmp eq i32 %50, 0
  br i1 %.not80.2, label %.preheader91, label %51

51:                                               ; preds = %47
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %50)
  br label %.preheader91

.preheader91:                                     ; preds = %51, %47
  %52 = getelementptr inbounds i8, ptr %6, i64 8
  %53 = getelementptr inbounds i8, ptr %10, i64 8
  store i16 4, ptr %6, align 8, !tbaa !9
  store ptr %16, ptr %52, align 8, !tbaa !13
  store i32 36, ptr %10, align 8, !tbaa !14
  store ptr %16, ptr %53, align 8, !tbaa !16
  %54 = load ptr, ptr %3, align 16, !tbaa !5
  %55 = call i32 @ups_db_insert(ptr noundef %54, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not79 = icmp eq i32 %55, 0
  br i1 %.not79, label %57, label %56

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

57:                                               ; preds = %.preheader91, %56
  store i16 4, ptr %6, align 8, !tbaa !9
  %58 = getelementptr inbounds i8, ptr %16, i64 36
  store ptr %58, ptr %52, align 8, !tbaa !13
  store i32 36, ptr %10, align 8, !tbaa !14
  store ptr %58, ptr %53, align 8, !tbaa !16
  %59 = load ptr, ptr %3, align 16, !tbaa !5
  %60 = call i32 @ups_db_insert(ptr noundef %59, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not79.1 = icmp eq i32 %60, 0
  br i1 %.not79.1, label %62, label %61

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

62:                                               ; preds = %61, %57
  store i16 4, ptr %6, align 8, !tbaa !9
  %63 = getelementptr inbounds i8, ptr %16, i64 72
  store ptr %63, ptr %52, align 8, !tbaa !13
  store i32 36, ptr %10, align 8, !tbaa !14
  store ptr %63, ptr %53, align 8, !tbaa !16
  %64 = load ptr, ptr %3, align 16, !tbaa !5
  %65 = call i32 @ups_db_insert(ptr noundef %64, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not79.2 = icmp eq i32 %65, 0
  br i1 %.not79.2, label %67, label %66

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

67:                                               ; preds = %66, %62
  store i16 4, ptr %6, align 8, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %16, i64 108
  store ptr %68, ptr %52, align 8, !tbaa !13
  store i32 36, ptr %10, align 8, !tbaa !14
  store ptr %68, ptr %53, align 8, !tbaa !16
  %69 = load ptr, ptr %3, align 16, !tbaa !5
  %70 = call i32 @ups_db_insert(ptr noundef %69, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not79.3 = icmp eq i32 %70, 0
  br i1 %.not79.3, label %.preheader90, label %71

71:                                               ; preds = %67
  call void @error(ptr noundef nonnull @.str.7, i32 noundef %70)
  br label %.preheader90

.preheader90:                                     ; preds = %71, %67
  store i16 4, ptr %6, align 8, !tbaa !9
  store ptr %17, ptr %52, align 8, !tbaa !13
  store i32 32, ptr %10, align 8, !tbaa !14
  %72 = getelementptr inbounds i8, ptr %17, i64 8
  store ptr %72, ptr %53, align 8, !tbaa !16
  %73 = load ptr, ptr %30, align 8, !tbaa !5
  %74 = call i32 @ups_db_insert(ptr noundef %73, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not78 = icmp eq i32 %74, 0
  br i1 %.not78, label %76, label %75

75:                                               ; preds = %.preheader90
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %74)
  br label %76

76:                                               ; preds = %.preheader90, %75
  store i16 4, ptr %6, align 8, !tbaa !9
  %77 = getelementptr inbounds i8, ptr %17, i64 40
  store ptr %77, ptr %52, align 8, !tbaa !13
  store i32 32, ptr %10, align 8, !tbaa !14
  %78 = getelementptr inbounds i8, ptr %17, i64 48
  store ptr %78, ptr %53, align 8, !tbaa !16
  %79 = load ptr, ptr %30, align 8, !tbaa !5
  %80 = call i32 @ups_db_insert(ptr noundef %79, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not78.1 = icmp eq i32 %80, 0
  br i1 %.not78.1, label %82, label %81

81:                                               ; preds = %76
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %80)
  br label %82

82:                                               ; preds = %81, %76
  store i16 4, ptr %6, align 8, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %17, i64 80
  store ptr %83, ptr %52, align 8, !tbaa !13
  store i32 32, ptr %10, align 8, !tbaa !14
  %84 = getelementptr inbounds i8, ptr %17, i64 88
  store ptr %84, ptr %53, align 8, !tbaa !16
  %85 = load ptr, ptr %30, align 8, !tbaa !5
  %86 = call i32 @ups_db_insert(ptr noundef %85, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not78.2 = icmp eq i32 %86, 0
  br i1 %.not78.2, label %88, label %87

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

88:                                               ; preds = %87, %82
  store i16 4, ptr %6, align 8, !tbaa !9
  %89 = getelementptr inbounds i8, ptr %17, i64 120
  store ptr %89, ptr %52, align 8, !tbaa !13
  store i32 32, ptr %10, align 8, !tbaa !14
  %90 = getelementptr inbounds i8, ptr %17, i64 128
  store ptr %90, ptr %53, align 8, !tbaa !16
  %91 = load ptr, ptr %30, align 8, !tbaa !5
  %92 = call i32 @ups_db_insert(ptr noundef %91, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not78.3 = icmp eq i32 %92, 0
  br i1 %.not78.3, label %94, label %93

93:                                               ; preds = %88
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %92)
  br label %94

94:                                               ; preds = %93, %88
  store i16 4, ptr %6, align 8, !tbaa !9
  %95 = getelementptr inbounds i8, ptr %17, i64 160
  store ptr %95, ptr %52, align 8, !tbaa !13
  store i32 32, ptr %10, align 8, !tbaa !14
  %96 = getelementptr inbounds i8, ptr %17, i64 168
  store ptr %96, ptr %53, align 8, !tbaa !16
  %97 = load ptr, ptr %30, align 8, !tbaa !5
  %98 = call i32 @ups_db_insert(ptr noundef %97, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not78.4 = icmp eq i32 %98, 0
  br i1 %.not78.4, label %100, label %99

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

100:                                              ; preds = %99, %94
  store i16 4, ptr %6, align 8, !tbaa !9
  %101 = getelementptr inbounds i8, ptr %17, i64 200
  store ptr %101, ptr %52, align 8, !tbaa !13
  store i32 32, ptr %10, align 8, !tbaa !14
  %102 = getelementptr inbounds i8, ptr %17, i64 208
  store ptr %102, ptr %53, align 8, !tbaa !16
  %103 = load ptr, ptr %30, align 8, !tbaa !5
  %104 = call i32 @ups_db_insert(ptr noundef %103, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not78.5 = icmp eq i32 %104, 0
  br i1 %.not78.5, label %106, label %105

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

106:                                              ; preds = %105, %100
  store i16 4, ptr %6, align 8, !tbaa !9
  %107 = getelementptr inbounds i8, ptr %17, i64 240
  store ptr %107, ptr %52, align 8, !tbaa !13
  store i32 32, ptr %10, align 8, !tbaa !14
  %108 = getelementptr inbounds i8, ptr %17, i64 248
  store ptr %108, ptr %53, align 8, !tbaa !16
  %109 = load ptr, ptr %30, align 8, !tbaa !5
  %110 = call i32 @ups_db_insert(ptr noundef %109, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not78.6 = icmp eq i32 %110, 0
  br i1 %.not78.6, label %112, label %111

111:                                              ; preds = %106
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %110)
  br label %112

112:                                              ; preds = %111, %106
  store i16 4, ptr %6, align 8, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %17, i64 280
  store ptr %113, ptr %52, align 8, !tbaa !13
  store i32 32, ptr %10, align 8, !tbaa !14
  %114 = getelementptr inbounds i8, ptr %17, i64 288
  store ptr %114, ptr %53, align 8, !tbaa !16
  %115 = load ptr, ptr %30, align 8, !tbaa !5
  %116 = call i32 @ups_db_insert(ptr noundef %115, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 0) #6
  %.not78.7 = icmp eq i32 %116, 0
  br i1 %.not78.7, label %.preheader89, label %117

117:                                              ; preds = %112
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %116)
  br label %.preheader89

.preheader89:                                     ; preds = %117, %112
  store i16 4, ptr %6, align 8, !tbaa !9
  %118 = getelementptr inbounds i8, ptr %17, i64 4
  store ptr %118, ptr %52, align 8, !tbaa !13
  store i32 4, ptr %10, align 8, !tbaa !14
  store ptr %17, ptr %53, align 8, !tbaa !16
  %119 = load ptr, ptr %35, align 16, !tbaa !5
  %120 = call i32 @ups_db_insert(ptr noundef %119, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 2) #6
  %.not77 = icmp eq i32 %120, 0
  br i1 %.not77, label %122, label %121

121:                                              ; preds = %.preheader89
  call void @error(ptr noundef nonnull @.str.9, i32 noundef %120)
  br label %122

122:                                              ; preds = %.preheader89, %121
  store i16 4, ptr %6, align 8, !tbaa !9
  %123 = getelementptr inbounds i8, ptr %17, i64 44
  store ptr %123, ptr %52, align 8, !tbaa !13
  store i32 4, ptr %10, align 8, !tbaa !14
  store ptr %77, ptr %53, align 8, !tbaa !16
  %124 = load ptr, ptr %35, align 16, !tbaa !5
  %125 = call i32 @ups_db_insert(ptr noundef %124, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 2) #6
  %.not77.1 = icmp eq i32 %125, 0
  br i1 %.not77.1, label %127, label %126

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

127:                                              ; preds = %126, %122
  store i16 4, ptr %6, align 8, !tbaa !9
  %128 = getelementptr inbounds i8, ptr %17, i64 84
  store ptr %128, ptr %52, align 8, !tbaa !13
  store i32 4, ptr %10, align 8, !tbaa !14
  store ptr %83, ptr %53, align 8, !tbaa !16
  %129 = load ptr, ptr %35, align 16, !tbaa !5
  %130 = call i32 @ups_db_insert(ptr noundef %129, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 2) #6
  %.not77.2 = icmp eq i32 %130, 0
  br i1 %.not77.2, label %132, label %131

131:                                              ; preds = %127
  call void @error(ptr noundef nonnull @.str.9, i32 noundef %130)
  br label %132

132:                                              ; preds = %131, %127
  store i16 4, ptr %6, align 8, !tbaa !9
  %133 = getelementptr inbounds i8, ptr %17, i64 124
  store ptr %133, ptr %52, align 8, !tbaa !13
  store i32 4, ptr %10, align 8, !tbaa !14
  store ptr %89, ptr %53, align 8, !tbaa !16
  %134 = load ptr, ptr %35, align 16, !tbaa !5
  %135 = call i32 @ups_db_insert(ptr noundef %134, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 2) #6
  %.not77.3 = icmp eq i32 %135, 0
  br i1 %.not77.3, label %137, label %136

136:                                              ; preds = %132
  call void @error(ptr noundef nonnull @.str.9, i32 noundef %135)
  br label %137

137:                                              ; preds = %136, %132
  store i16 4, ptr %6, align 8, !tbaa !9
  %138 = getelementptr inbounds i8, ptr %17, i64 164
  store ptr %138, ptr %52, align 8, !tbaa !13
  store i32 4, ptr %10, align 8, !tbaa !14
  store ptr %95, ptr %53, align 8, !tbaa !16
  %139 = load ptr, ptr %35, align 16, !tbaa !5
  %140 = call i32 @ups_db_insert(ptr noundef %139, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 2) #6
  %.not77.4 = icmp eq i32 %140, 0
  br i1 %.not77.4, label %142, label %141

141:                                              ; preds = %137
  call void @error(ptr noundef nonnull @.str.9, i32 noundef %140)
  br label %142

142:                                              ; preds = %141, %137
  store i16 4, ptr %6, align 8, !tbaa !9
  %143 = getelementptr inbounds i8, ptr %17, i64 204
  store ptr %143, ptr %52, align 8, !tbaa !13
  store i32 4, ptr %10, align 8, !tbaa !14
  store ptr %101, ptr %53, align 8, !tbaa !16
  %144 = load ptr, ptr %35, align 16, !tbaa !5
  %145 = call i32 @ups_db_insert(ptr noundef %144, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 2) #6
  %.not77.5 = icmp eq i32 %145, 0
  br i1 %.not77.5, label %147, label %146

146:                                              ; preds = %142
  call void @error(ptr noundef nonnull @.str.9, i32 noundef %145)
  br label %147

147:                                              ; preds = %146, %142
  store i16 4, ptr %6, align 8, !tbaa !9
  %148 = getelementptr inbounds i8, ptr %17, i64 244
  store ptr %148, ptr %52, align 8, !tbaa !13
  store i32 4, ptr %10, align 8, !tbaa !14
  store ptr %107, ptr %53, align 8, !tbaa !16
  %149 = load ptr, ptr %35, align 16, !tbaa !5
  %150 = call i32 @ups_db_insert(ptr noundef %149, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 2) #6
  %.not77.6 = icmp eq i32 %150, 0
  br i1 %.not77.6, label %152, label %151

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

152:                                              ; preds = %151, %147
  store i16 4, ptr %6, align 8, !tbaa !9
  %153 = getelementptr inbounds i8, ptr %17, i64 284
  store ptr %153, ptr %52, align 8, !tbaa !13
  store i32 4, ptr %10, align 8, !tbaa !14
  store ptr %113, ptr %53, align 8, !tbaa !16
  %154 = load ptr, ptr %35, align 16, !tbaa !5
  %155 = call i32 @ups_db_insert(ptr noundef %154, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %10, i32 noundef 2) #6
  %.not77.7 = icmp eq i32 %155, 0
  br i1 %.not77.7, label %.preheader, label %156

156:                                              ; preds = %152
  call void @error(ptr noundef nonnull @.str.9, i32 noundef %155)
  br label %.preheader

.preheader:                                       ; preds = %156, %152
  %157 = getelementptr inbounds i8, ptr %11, i64 8
  %158 = getelementptr inbounds i8, ptr %9, i64 8
  %159 = getelementptr inbounds i8, ptr %13, i64 8
  %160 = getelementptr inbounds i8, ptr %8, i64 8
  %161 = getelementptr inbounds i8, ptr %12, i64 8
  br label %162

162:                                              ; preds = %.backedge, %.preheader
  %163 = load ptr, ptr %5, align 16, !tbaa !5
  %164 = call i32 @ups_cursor_move(ptr noundef %163, ptr noundef nonnull %7, ptr noundef nonnull %11, i32 noundef 4) #6
  switch i32 %164, label %165 [
    i32 0, label %166
    i32 -11, label %192
  ]

165:                                              ; preds = %162
  call void @error(ptr noundef nonnull @.str.10, i32 noundef %164)
  br label %166

166:                                              ; preds = %162, %165
  %167 = load ptr, ptr %157, align 8, !tbaa !16
  %168 = load i32, ptr %167, align 4, !tbaa !17
  %169 = getelementptr inbounds i8, ptr %167, i64 4
  %170 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %168, ptr noundef nonnull %169)
  store ptr %167, ptr %158, align 8, !tbaa !13
  store i16 4, ptr %9, align 8, !tbaa !9
  %171 = load ptr, ptr %48, align 16, !tbaa !5
  %172 = call i32 @ups_cursor_find(ptr noundef %171, ptr noundef nonnull %9, ptr noundef null, i32 noundef 0) #6
  switch i32 %172, label %173 [
    i32 0, label %174
    i32 -11, label %.backedge
  ]

173:                                              ; preds = %166
  call void @error(ptr noundef nonnull @.str.12, i32 noundef %172)
  br label %174

174:                                              ; preds = %166, %173
  %175 = load ptr, ptr %48, align 16, !tbaa !5
  %176 = call i32 @ups_cursor_move(ptr noundef %175, ptr noundef null, ptr noundef nonnull %13, i32 noundef 0) #6
  %.not73 = icmp eq i32 %176, 0
  br i1 %.not73, label %.preheader100, label %177

177:                                              ; preds = %174
  call void @error(ptr noundef nonnull @.str.13, i32 noundef %176)
  br label %.preheader100

.preheader100:                                    ; preds = %177, %174
  br label %178

178:                                              ; preds = %.preheader100, %191
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #6
  %179 = load ptr, ptr %159, align 8, !tbaa !16
  %180 = load i32, ptr %179, align 4, !tbaa !19
  store i32 %180, ptr %18, align 4, !tbaa !19
  store ptr %18, ptr %160, align 8, !tbaa !13
  store i16 4, ptr %8, align 8, !tbaa !9
  %181 = load ptr, ptr %30, align 8, !tbaa !5
  %182 = call i32 @ups_db_find(ptr noundef %181, ptr noundef null, ptr noundef nonnull %8, ptr noundef nonnull %12, i32 noundef 0) #6
  %.not74 = icmp eq i32 %182, 0
  br i1 %.not74, label %184, label %183

183:                                              ; preds = %178
  call void @error(ptr noundef nonnull @.str.14, i32 noundef %182)
  br label %184

184:                                              ; preds = %183, %178
  %185 = load i32, ptr %18, align 4, !tbaa !19
  %186 = load ptr, ptr %161, align 8, !tbaa !16
  %187 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %185, ptr noundef %186)
  %188 = load ptr, ptr %48, align 16, !tbaa !5
  %189 = call i32 @ups_cursor_move(ptr noundef %188, ptr noundef nonnull %9, ptr noundef nonnull %13, i32 noundef 36) #6
  switch i32 %189, label %190 [
    i32 0, label %191
    i32 -11, label %.thread
  ]

.thread:                                          ; preds = %184
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #6
  br label %.backedge

.backedge:                                        ; preds = %.thread, %166
  br label %162

190:                                              ; preds = %184
  call void @error(ptr noundef nonnull @.str.16, i32 noundef %189)
  br label %191

191:                                              ; preds = %190, %184
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #6
  br label %178

192:                                              ; preds = %162
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = call i32 @ups_env_close(ptr noundef %193, i32 noundef 1) #6
  %.not76 = icmp eq i32 %194, 0
  br i1 %.not76, label %196, label %195

195:                                              ; preds = %192
  call void @error(ptr noundef nonnull @.str.17, i32 noundef %194)
  br label %196

196:                                              ; preds = %195, %192
  %197 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  call void @llvm.lifetime.end.p0(i64 320, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 24, 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 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 24, 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_move(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

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

declare i32 @ups_db_find(ptr noundef, 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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = !{!12, !12, i64 0}


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