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

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

@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 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 [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = 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 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)
  %13 = call i32 @ups_env_create(ptr noundef %8, ptr noundef @.str.1, i32 noundef 0, i32 noundef 0, ptr noundef null)
  store i32 %13, ptr %7, align 4, !tbaa !5
  %14 = load i32, ptr %7, align 4, !tbaa !5
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %18

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

18:                                               ; preds = %16, %2
  %19 = load ptr, ptr %8, align 8, !tbaa !9
  %20 = call i32 @ups_env_open_db(ptr noundef %19, ptr noundef %9, i16 noundef zeroext 13, i32 noundef 0, 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 = %18
  %24 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.3, i32 noundef %24)
  br label %25

25:                                               ; preds = %23, %18
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %46, %25
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 1000
  br i1 %28, label %29, label %49

29:                                               ; preds = %26
  %30 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  store ptr %6, ptr %30, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  store i16 4, ptr %31, align 8, !tbaa !14
  %32 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  %33 = load i16, ptr %32, align 8, !tbaa !14
  %34 = zext i16 %33 to i32
  %35 = getelementptr inbounds %struct.ups_record_t, ptr %11, i32 0, i32 0
  store i32 %34, ptr %35, align 8, !tbaa !15
  %36 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds %struct.ups_record_t, ptr %11, i32 0, i32 1
  store ptr %37, ptr %38, align 8, !tbaa !17
  %39 = load ptr, ptr %9, align 8, !tbaa !9
  %40 = call i32 @ups_db_insert(ptr noundef %39, ptr noundef null, ptr noundef %10, ptr noundef %11, i32 noundef 0)
  store i32 %40, ptr %7, align 4, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %45

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

45:                                               ; preds = %43, %29
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %6, align 4, !tbaa !5
  br label %26, !llvm.loop !18

49:                                               ; preds = %26
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %71, %49
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = icmp slt i32 %51, 1000
  br i1 %52, label %53, label %74

53:                                               ; preds = %50
  %54 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  store ptr %6, ptr %54, align 8, !tbaa !11
  %55 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  store i16 4, ptr %55, align 8, !tbaa !14
  %56 = load ptr, ptr %9, align 8, !tbaa !9
  %57 = call i32 @ups_db_find(ptr noundef %56, ptr noundef null, ptr noundef %10, ptr noundef %11, i32 noundef 0)
  store i32 %57, ptr %7, align 4, !tbaa !5
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %62

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

62:                                               ; preds = %60, %53
  %63 = getelementptr inbounds %struct.ups_record_t, ptr %11, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !17
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = icmp ne i32 %65, %66
  br i1 %67, label %68, label %70

68:                                               ; preds = %62
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %124

70:                                               ; preds = %62
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %6, align 4, !tbaa !5
  br label %50, !llvm.loop !20

74:                                               ; preds = %50
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %88, %74
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = icmp slt i32 %76, 1000
  br i1 %77, label %78, label %91

78:                                               ; preds = %75
  %79 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  store ptr %6, ptr %79, align 8, !tbaa !11
  %80 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  store i16 4, ptr %80, align 8, !tbaa !14
  %81 = load ptr, ptr %9, align 8, !tbaa !9
  %82 = call i32 @ups_db_erase(ptr noundef %81, ptr noundef null, ptr noundef %10, i32 noundef 0)
  store i32 %82, ptr %7, align 4, !tbaa !5
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %87

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

87:                                               ; preds = %85, %78
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %6, align 4, !tbaa !5
  br label %75, !llvm.loop !21

91:                                               ; preds = %75
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %105, %91
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = icmp slt i32 %93, 1000
  br i1 %94, label %95, label %108

95:                                               ; preds = %92
  %96 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 1
  store ptr %6, ptr %96, align 8, !tbaa !11
  %97 = getelementptr inbounds %struct.ups_key_t, ptr %10, i32 0, i32 0
  store i16 4, ptr %97, align 8, !tbaa !14
  %98 = load ptr, ptr %9, align 8, !tbaa !9
  %99 = call i32 @ups_db_find(ptr noundef %98, ptr noundef null, ptr noundef %10, ptr noundef %11, i32 noundef 0)
  store i32 %99, ptr %7, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = icmp ne i32 %100, -11
  br i1 %101, label %102, label %104

102:                                              ; preds = %95
  %103 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.5, i32 noundef %103)
  br label %104

104:                                              ; preds = %102, %95
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %6, align 4, !tbaa !5
  br label %92, !llvm.loop !22

108:                                              ; preds = %92
  %109 = load ptr, ptr %9, align 8, !tbaa !9
  %110 = call i32 @ups_db_close(ptr noundef %109, i32 noundef 0)
  store i32 %110, ptr %7, align 4, !tbaa !5
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %115

113:                                              ; preds = %108
  %114 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.8, i32 noundef %114)
  br label %115

115:                                              ; preds = %113, %108
  %116 = load ptr, ptr %8, align 8, !tbaa !9
  %117 = call i32 @ups_env_close(ptr noundef %116, 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 = %115
  %121 = load i32, ptr %7, align 4, !tbaa !5
  call void @error(ptr noundef @.str.9, i32 noundef %121)
  br label %122

122:                                              ; preds = %120, %115
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %124

124:                                              ; preds = %122, %68
  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
  %125 = load i32, ptr %3, align 4
  ret i32 %125
}

; 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_open_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_erase(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

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

@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 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 [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = 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
  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)
  %8 = call i32 @ups_env_create(ptr noundef nonnull %4, ptr noundef nonnull @.str.1, i32 noundef 0, i32 noundef 0, ptr noundef null) #5
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %10, label %9

9:                                                ; preds = %2
  call void @error(ptr noundef nonnull @.str.2, i32 noundef %8)
  br label %10

10:                                               ; preds = %9, %2
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = call i32 @ups_env_open_db(ptr noundef %11, ptr noundef nonnull %5, i16 noundef zeroext 13, i32 noundef 0, ptr noundef null) #5
  %.not26 = icmp eq i32 %12, 0
  br i1 %.not26, label %14, label %13

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

14:                                               ; preds = %13, %10
  %15 = getelementptr inbounds i8, ptr %6, i64 8
  %16 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %17

.preheader38:                                     ; preds = %21
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %28

17:                                               ; preds = %14, %21
  store ptr %3, ptr %15, 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 %16, align 8, !tbaa !17
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call i32 @ups_db_insert(ptr noundef %18, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef 0) #5
  %.not36 = icmp eq i32 %19, 0
  br i1 %.not36, label %21, label %20

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

21:                                               ; preds = %17, %20
  %22 = load i32, ptr %3, align 4, !tbaa !9
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !9
  %24 = icmp slt i32 %22, 999
  br i1 %24, label %17, label %.preheader38, !llvm.loop !18

25:                                               ; preds = %32
  %26 = add nsw i32 %34, 1
  store i32 %26, ptr %3, align 4, !tbaa !9
  %27 = icmp slt i32 %34, 999
  br i1 %27, label %28, label %.preheader37, !llvm.loop !20

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

28:                                               ; preds = %.preheader38, %25
  store ptr %3, ptr %15, align 8, !tbaa !11
  store i16 4, ptr %6, align 8, !tbaa !14
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call i32 @ups_db_find(ptr noundef %29, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef 0) #5
  %.not34 = icmp eq i32 %30, 0
  br i1 %.not34, label %32, label %31

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

32:                                               ; preds = %31, %28
  %33 = load ptr, ptr %16, align 8, !tbaa !17
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = load i32, ptr %3, align 4, !tbaa !9
  %.not35 = icmp eq i32 %34, %35
  br i1 %.not35, label %25, label %.loopexit

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

36:                                               ; preds = %.preheader37, %40
  store ptr %3, ptr %15, align 8, !tbaa !11
  store i16 4, ptr %6, align 8, !tbaa !14
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call i32 @ups_db_erase(ptr noundef %37, ptr noundef null, ptr noundef nonnull %6, i32 noundef 0) #5
  %.not33 = icmp eq i32 %38, 0
  br i1 %.not33, label %40, label %39

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

40:                                               ; preds = %36, %39
  %41 = load i32, ptr %3, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %3, align 4, !tbaa !9
  %43 = icmp slt i32 %41, 999
  br i1 %43, label %36, label %.preheader, !llvm.loop !21

44:                                               ; preds = %.preheader, %48
  store ptr %3, ptr %15, align 8, !tbaa !11
  store i16 4, ptr %6, align 8, !tbaa !14
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call i32 @ups_db_find(ptr noundef %45, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef 0) #5
  %.not32 = icmp eq i32 %46, -11
  br i1 %.not32, label %48, label %47

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

48:                                               ; preds = %44, %47
  %49 = load i32, ptr %3, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %3, align 4, !tbaa !9
  %51 = icmp slt i32 %49, 999
  br i1 %51, label %44, label %52, !llvm.loop !22

52:                                               ; preds = %48
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = call i32 @ups_db_close(ptr noundef %53, i32 noundef 0) #5
  %.not30 = icmp eq i32 %54, 0
  br i1 %.not30, label %56, label %55

55:                                               ; preds = %52
  call void @error(ptr noundef nonnull @.str.8, i32 noundef %54)
  br label %56

56:                                               ; preds = %55, %52
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = call i32 @ups_env_close(ptr noundef %57, i32 noundef 0) #5
  %.not31 = icmp eq i32 %58, 0
  br i1 %.not31, label %.loopexit, label %59

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

.loopexit:                                        ; preds = %32, %56, %59
  %.str.10.sink = phi ptr [ @.str.10, %59 ], [ @.str.10, %56 ], [ @.str.6, %32 ]
  %.0 = phi i32 [ 0, %59 ], [ 0, %56 ], [ -1, %32 ]
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.10.sink)
  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_open_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_erase(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

; 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