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

; 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_key_t = type { i16, ptr, i32, i32 }
%struct.ups_record_t = type { i32, ptr, i32 }
%struct.ups_parameter_t = type { i32, i64 }

@.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 [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = 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 ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.ups_key_t, align 8
  %11 = alloca %struct.ups_record_t, align 8
  %12 = alloca [3 x %struct.ups_parameter_t], align 16
  %13 = 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) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #4
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 48, i1 false)
  %14 = getelementptr inbounds [3 x %struct.ups_parameter_t], ptr %12, i32 0, i32 0
  %15 = getelementptr inbounds %struct.ups_parameter_t, ptr %14, i32 0, i32 0
  store i32 260, ptr %15, align 16
  %16 = getelementptr inbounds %struct.ups_parameter_t, ptr %14, i32 0, i32 1
  store i64 7, ptr %16, align 8
  %17 = getelementptr inbounds [3 x %struct.ups_parameter_t], ptr %12, i32 0, i32 1
  %18 = getelementptr inbounds %struct.ups_parameter_t, ptr %17, i32 0, i32 0
  store i32 264, ptr %18, align 16
  %19 = getelementptr inbounds %struct.ups_parameter_t, ptr %17, i32 0, i32 1
  store i64 4, ptr %19, align 8
  %20 = call i32 @ups_env_create(ptr noundef %8, ptr noundef @.str.1, i32 noundef 0, i32 noundef 436, ptr noundef null)
  store i32 %20, ptr %7, align 4, !tbaa !5
  %21 = load i32, ptr %7, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %25

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

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

31:                                               ; preds = %25
  %32 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.3, i32 noundef %32)
  br label %33

33:                                               ; preds = %31, %25
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %54, %33
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = icmp ult i32 %35, 10
  br i1 %36, label %37, label %57

37:                                               ; preds = %34
  %38 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  store ptr %6, ptr %38, align 8, !tbaa !11
  %39 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  store i16 4, ptr %39, align 8, !tbaa !14
  %40 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  %41 = load i16, ptr %40, align 8, !tbaa !14
  %42 = zext i16 %41 to i32
  %43 = getelementptr inbounds %struct.ups_record_t, ptr %11, i32 0, i32 0
  store i32 %42, ptr %43, align 8, !tbaa !15
  %44 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds %struct.ups_record_t, ptr %11, i32 0, i32 1
  store ptr %45, ptr %46, align 8, !tbaa !17
  %47 = load ptr, ptr %9, align 8, !tbaa !9
  %48 = call i32 @ups_db_insert(ptr noundef %47, ptr noundef null, ptr noundef %10, ptr noundef %11, i32 noundef 0)
  store i32 %48, ptr %7, align 4, !tbaa !5
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %53

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

53:                                               ; preds = %51, %37
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = add i32 %55, 1
  store i32 %56, ptr %6, align 4, !tbaa !5
  br label %34, !llvm.loop !18

57:                                               ; preds = %34
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %79, %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = icmp ult i32 %59, 10
  br i1 %60, label %61, label %82

61:                                               ; preds = %58
  %62 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  store ptr %6, ptr %62, align 8, !tbaa !11
  %63 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  store i16 4, ptr %63, align 8, !tbaa !14
  %64 = load ptr, ptr %9, align 8, !tbaa !9
  %65 = call i32 @ups_db_find(ptr noundef %64, ptr noundef null, ptr noundef %10, ptr noundef %11, i32 noundef 0)
  store i32 %65, ptr %7, align 4, !tbaa !5
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %70

68:                                               ; preds = %61
  %69 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.5, i32 noundef %69)
  br label %70

70:                                               ; preds = %68, %61
  %71 = getelementptr inbounds %struct.ups_record_t, ptr %11, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !17
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = icmp ne i32 %73, %74
  br i1 %75, label %76, label %78

76:                                               ; preds = %70
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %152

78:                                               ; preds = %70
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = add i32 %80, 1
  store i32 %81, ptr %6, align 4, !tbaa !5
  br label %58, !llvm.loop !20

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

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

89:                                               ; preds = %87, %82
  %90 = load ptr, ptr %8, align 8, !tbaa !9
  %91 = call i32 @ups_env_close(ptr noundef %90, i32 noundef 0)
  store i32 %91, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %96

94:                                               ; preds = %89
  %95 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.8, i32 noundef %95)
  br label %96

96:                                               ; preds = %94, %89
  %97 = call i32 @ups_env_open(ptr noundef %8, ptr noundef @.str.1, i32 noundef 0, ptr noundef null)
  store i32 %97, ptr %7, align 4, !tbaa !5
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %102

100:                                              ; preds = %96
  %101 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.9, i32 noundef %101)
  br label %102

102:                                              ; preds = %100, %96
  %103 = load ptr, ptr %8, align 8, !tbaa !9
  %104 = call i32 @ups_env_open_db(ptr noundef %103, ptr noundef %9, i16 noundef zeroext 1, i32 noundef 0, ptr noundef null)
  store i32 %104, ptr %7, align 4, !tbaa !5
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %109

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

109:                                              ; preds = %107, %102
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %123, %109
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = icmp ult i32 %111, 10
  br i1 %112, label %113, label %126

113:                                              ; preds = %110
  %114 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  store i16 4, ptr %114, align 8, !tbaa !14
  %115 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  store ptr %6, ptr %115, align 8, !tbaa !11
  %116 = load ptr, ptr %9, align 8, !tbaa !9
  %117 = call i32 @ups_db_erase(ptr noundef %116, ptr noundef null, ptr noundef %10, i32 noundef 0)
  store i32 %117, ptr %7, align 4, !tbaa !5
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %122

120:                                              ; preds = %113
  %121 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.11, i32 noundef %121)
  br label %122

122:                                              ; preds = %120, %113
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = add i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !5
  br label %110, !llvm.loop !21

126:                                              ; preds = %110
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %140, %126
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = icmp ult i32 %128, 10
  br i1 %129, label %130, label %143

130:                                              ; preds = %127
  %131 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  store i16 4, ptr %131, align 8, !tbaa !14
  %132 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  store ptr %6, ptr %132, align 8, !tbaa !11
  %133 = load ptr, ptr %9, align 8, !tbaa !9
  %134 = call i32 @ups_db_find(ptr noundef %133, ptr noundef null, ptr noundef %10, ptr noundef %11, i32 noundef 0)
  store i32 %134, ptr %7, align 4, !tbaa !5
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = icmp ne i32 %135, -11
  br i1 %136, label %137, label %139

137:                                              ; preds = %130
  %138 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.5, i32 noundef %138)
  br label %139

139:                                              ; preds = %137, %130
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = add i32 %141, 1
  store i32 %142, ptr %6, align 4, !tbaa !5
  br label %127, !llvm.loop !22

143:                                              ; preds = %127
  %144 = load ptr, ptr %8, align 8, !tbaa !9
  %145 = call i32 @ups_env_close(ptr noundef %144, i32 noundef 1)
  store i32 %145, ptr %7, align 4, !tbaa !5
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %150

148:                                              ; preds = %143
  %149 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.8, i32 noundef %149)
  br label %150

150:                                              ; preds = %148, %143
  %151 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %152

152:                                              ; preds = %150, %76
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %153 = load i32, ptr %3, align 4
  ret i32 %153
}

; 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

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_db_insert(ptr noundef, 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

declare i32 @ups_db_close(ptr noundef, i32 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_db_erase(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 = { 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 = !{!12, !10, i64 8}
!12 = !{!"", !13, i64 0, !10, i64 8, !6, i64 16, !6, i64 20}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"", !6, i64 0, !10, i64 8, !6, i64 16}
!17 = !{!16, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}


; 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_key_t = type { i16, ptr, i32, i32 }
%struct.ups_record_t = type { i32, ptr, i32 }
%struct.ups_parameter_t = type { i32, i64 }

@.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 [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = 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 i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.ups_key_t, align 8
  %7 = alloca %struct.ups_record_t, align 8
  %8 = alloca [3 x %struct.ups_parameter_t], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  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) #5
  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 48, ptr nonnull %8) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %8, i8 0, i64 48, i1 false)
  store i32 260, ptr %8, align 16
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  store i64 7, ptr %9, align 8
  %10 = getelementptr inbounds i8, ptr %8, i64 16
  store i32 264, ptr %10, align 16
  %11 = getelementptr inbounds i8, ptr %8, i64 24
  store i64 4, ptr %11, align 8
  %12 = call i32 @ups_env_create(ptr noundef nonnull %4, ptr noundef nonnull @.str.1, i32 noundef 0, i32 noundef 436, ptr noundef null) #5
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %14, label %13

13:                                               ; preds = %2
  call void @error(ptr noundef nonnull @.str.2, i32 noundef %12)
  br label %14

14:                                               ; preds = %13, %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call i32 @ups_env_create_db(ptr noundef %15, ptr noundef nonnull %5, i16 noundef zeroext 1, i32 noundef 0, ptr noundef nonnull %8) #5
  %.not35 = icmp eq i32 %16, 0
  br i1 %.not35, label %18, label %17

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

18:                                               ; preds = %17, %14
  %19 = getelementptr inbounds i8, ptr %6, i64 8
  %20 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %21

.preheader49:                                     ; preds = %25
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %32

21:                                               ; preds = %18, %25
  store ptr %3, ptr %19, align 8, !tbaa !11
  store i16 4, ptr %6, align 8, !tbaa !14
  store i32 4, ptr %7, align 8, !tbaa !15
  store ptr %3, ptr %20, align 8, !tbaa !17
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call i32 @ups_db_insert(ptr noundef %22, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef 0) #5
  %.not48 = icmp eq i32 %23, 0
  br i1 %.not48, label %25, label %24

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

25:                                               ; preds = %21, %24
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = add i32 %26, 1
  store i32 %27, ptr %3, align 4, !tbaa !9
  %28 = icmp ult i32 %27, 10
  br i1 %28, label %21, label %.preheader49, !llvm.loop !18

29:                                               ; preds = %36
  %30 = add i32 %38, 1
  store i32 %30, ptr %3, align 4, !tbaa !9
  %31 = icmp ult i32 %30, 10
  br i1 %31, label %32, label %40, !llvm.loop !20

32:                                               ; preds = %.preheader49, %29
  store ptr %3, ptr %19, align 8, !tbaa !11
  store i16 4, ptr %6, align 8, !tbaa !14
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call i32 @ups_db_find(ptr noundef %33, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef 0) #5
  %.not46 = icmp eq i32 %34, 0
  br i1 %.not46, label %36, label %35

35:                                               ; preds = %32
  call void @error(ptr noundef nonnull @.str.5, i32 noundef %34)
  br label %36

36:                                               ; preds = %35, %32
  %37 = load ptr, ptr %20, align 8, !tbaa !17
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = load i32, ptr %3, align 4, !tbaa !9
  %.not47 = icmp eq i32 %38, %39
  br i1 %.not47, label %29, label %.loopexit

40:                                               ; preds = %29
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call i32 @ups_db_close(ptr noundef %41, i32 noundef 0) #5
  %.not37 = icmp eq i32 %42, 0
  br i1 %.not37, label %44, label %43

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

44:                                               ; preds = %43, %40
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = call i32 @ups_env_close(ptr noundef %45, i32 noundef 0) #5
  %.not38 = icmp eq i32 %46, 0
  br i1 %.not38, label %48, label %47

47:                                               ; preds = %44
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %46)
  br label %48

48:                                               ; preds = %47, %44
  %49 = call i32 @ups_env_open(ptr noundef nonnull %4, ptr noundef nonnull @.str.1, i32 noundef 0, ptr noundef null) #5
  %.not39 = icmp eq i32 %49, 0
  br i1 %.not39, label %51, label %50

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

51:                                               ; preds = %50, %48
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = call i32 @ups_env_open_db(ptr noundef %52, ptr noundef nonnull %5, i16 noundef zeroext 1, i32 noundef 0, ptr noundef null) #5
  %.not40 = icmp eq i32 %53, 0
  br i1 %.not40, label %55, label %54

54:                                               ; preds = %51
  call void @error(ptr noundef nonnull @.str.10, i32 noundef %53)
  br label %55

55:                                               ; preds = %54, %51
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %56

.preheader:                                       ; preds = %60
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %64

56:                                               ; preds = %55, %60
  store i16 4, ptr %6, align 8, !tbaa !14
  store ptr %3, ptr %19, align 8, !tbaa !11
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = call i32 @ups_db_erase(ptr noundef %57, ptr noundef null, ptr noundef nonnull %6, i32 noundef 0) #5
  %.not45 = icmp eq i32 %58, 0
  br i1 %.not45, label %60, label %59

59:                                               ; preds = %56
  call void @error(ptr noundef nonnull @.str.11, i32 noundef %58)
  br label %60

60:                                               ; preds = %56, %59
  %61 = load i32, ptr %3, align 4, !tbaa !9
  %62 = add i32 %61, 1
  store i32 %62, ptr %3, align 4, !tbaa !9
  %63 = icmp ult i32 %62, 10
  br i1 %63, label %56, label %.preheader, !llvm.loop !21

64:                                               ; preds = %.preheader, %68
  store i16 4, ptr %6, align 8, !tbaa !14
  store ptr %3, ptr %19, align 8, !tbaa !11
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = call i32 @ups_db_find(ptr noundef %65, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef 0) #5
  %.not44 = icmp eq i32 %66, -11
  br i1 %.not44, label %68, label %67

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

68:                                               ; preds = %64, %67
  %69 = load i32, ptr %3, align 4, !tbaa !9
  %70 = add i32 %69, 1
  store i32 %70, ptr %3, align 4, !tbaa !9
  %71 = icmp ult i32 %70, 10
  br i1 %71, label %64, label %72, !llvm.loop !22

72:                                               ; preds = %68
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = call i32 @ups_env_close(ptr noundef %73, i32 noundef 1) #5
  %.not43 = icmp eq i32 %74, 0
  br i1 %.not43, label %.loopexit, label %75

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

.loopexit:                                        ; preds = %36, %72, %75
  %.str.12.sink = phi ptr [ @.str.12, %75 ], [ @.str.12, %72 ], [ @.str.6, %36 ]
  %.0 = phi i32 [ 0, %75 ], [ 0, %72 ], [ -1, %36 ]
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.12.sink)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  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

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

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

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

declare i32 @ups_db_find(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @ups_db_close(ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

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

declare i32 @ups_db_erase(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass