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

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

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

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

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

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

37:                                               ; preds = %35, %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %56, %37
  %39 = load i32, ptr %10, align 4, !tbaa !5
  %40 = icmp slt i32 %39, 10000
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %59

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %43 = load i32, ptr %10, align 4, !tbaa !5
  %44 = srem i32 %43, 30
  %45 = add nsw i32 1, %44
  store i32 %45, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #4
  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) #4
  %46 = getelementptr inbounds %struct.ups_record_t, ptr %13, i32 0, i32 0
  store i32 4, ptr %46, align 8, !tbaa !11
  %47 = getelementptr inbounds %struct.ups_record_t, ptr %13, i32 0, i32 1
  store ptr %11, ptr %47, align 8, !tbaa !13
  %48 = getelementptr inbounds %struct.ups_record_t, ptr %13, i32 0, i32 2
  store i32 0, ptr %48, align 8, !tbaa !14
  %49 = load ptr, ptr %8, align 8, !tbaa !9
  %50 = call i32 @ups_db_insert(ptr noundef %49, ptr noundef null, ptr noundef %12, ptr noundef %13, i32 noundef 0)
  store i32 %50, ptr %6, align 4, !tbaa !5
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %55

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

55:                                               ; preds = %53, %42
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %10, align 4, !tbaa !5
  br label %38, !llvm.loop !15

59:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #4
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr %16) #4
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 72, i1 false)
  %60 = getelementptr inbounds %struct.uqi_plugin_t, ptr %16, i32 0, i32 0
  store ptr @.str.5, ptr %60, align 8, !tbaa !17
  %61 = getelementptr inbounds %struct.uqi_plugin_t, ptr %16, i32 0, i32 1
  store i32 2, ptr %61, align 8, !tbaa !19
  %62 = getelementptr inbounds %struct.uqi_plugin_t, ptr %16, i32 0, i32 4
  store ptr @mycount_init, ptr %62, align 8, !tbaa !20
  %63 = getelementptr inbounds %struct.uqi_plugin_t, ptr %16, i32 0, i32 5
  store ptr @mycount_cleanup, ptr %63, align 8, !tbaa !21
  %64 = getelementptr inbounds %struct.uqi_plugin_t, ptr %16, i32 0, i32 6
  store ptr @mycount_single, ptr %64, align 8, !tbaa !22
  %65 = getelementptr inbounds %struct.uqi_plugin_t, ptr %16, i32 0, i32 7
  store ptr @mycount_many, ptr %65, align 8, !tbaa !23
  %66 = getelementptr inbounds %struct.uqi_plugin_t, ptr %16, i32 0, i32 9
  store ptr @mycount_results, ptr %66, align 8, !tbaa !24
  %67 = call i32 @uqi_register_plugin(ptr noundef %16)
  store i32 %67, ptr %6, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %59
  %71 = load i32, ptr %6, align 4, !tbaa !5
  call void @error(ptr noundef @.str.6, i32 noundef %71)
  br label %72

72:                                               ; preds = %70, %59
  call void @llvm.lifetime.start.p0(i64 72, ptr %17) #4
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 72, i1 false)
  %73 = getelementptr inbounds %struct.uqi_plugin_t, ptr %17, i32 0, i32 1
  store i32 1, ptr %73, align 8, !tbaa !19
  %74 = getelementptr inbounds %struct.uqi_plugin_t, ptr %17, i32 0, i32 0
  store ptr @.str.7, ptr %74, align 8, !tbaa !17
  %75 = getelementptr inbounds %struct.uqi_plugin_t, ptr %17, i32 0, i32 8
  store ptr @equals10_predicate, ptr %75, align 8, !tbaa !25
  %76 = call i32 @uqi_register_plugin(ptr noundef %17)
  store i32 %76, ptr %6, align 4, !tbaa !5
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %81

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

81:                                               ; preds = %79, %72
  %82 = load ptr, ptr %7, align 8, !tbaa !9
  %83 = call i32 @uqi_select(ptr noundef %82, ptr noundef @.str.8, ptr noundef %14)
  store i32 %83, ptr %6, align 4, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %81
  %87 = load i32, ptr %6, align 4, !tbaa !5
  call void @error(ptr noundef @.str.9, i32 noundef %87)
  br label %88

88:                                               ; preds = %86, %81
  %89 = load ptr, ptr %14, align 8, !tbaa !9
  call void @uqi_result_get_record(ptr noundef %89, i32 noundef 0, ptr noundef %15)
  %90 = getelementptr inbounds %struct.ups_record_t, ptr %15, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !13
  %92 = load i64, ptr %91, align 8, !tbaa !26
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i64 noundef %92)
  %94 = load ptr, ptr %14, align 8, !tbaa !9
  call void @uqi_result_close(ptr noundef %94)
  %95 = load ptr, ptr %7, align 8, !tbaa !9
  %96 = call i32 @ups_env_close(ptr noundef %95, i32 noundef 1)
  store i32 %96, ptr %6, align 4, !tbaa !5
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %101

99:                                               ; preds = %88
  %100 = load i32, ptr %6, align 4, !tbaa !5
  call void @error(ptr noundef @.str.11, i32 noundef %100)
  br label %101

101:                                              ; preds = %99, %88
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  call void @llvm.lifetime.end.p0(i64 72, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  ret i32 0
}

; 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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @mycount_cleanup(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden void @mycount_many(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #0

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

declare i32 @uqi_register_plugin(ptr noundef) #1

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

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

declare void @uqi_result_get_record(ptr noundef, i32 noundef, ptr noundef) #1

declare void @uqi_result_close(ptr noundef) #1

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 = { 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, !6, i64 0}
!12 = !{!"", !6, i64 0, !10, i64 8, !6, i64 16}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !6, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !10, i64 0}
!18 = !{!"", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!19 = !{!18, !6, i64 8}
!20 = !{!18, !10, i64 24}
!21 = !{!18, !10, i64 32}
!22 = !{!18, !10, i64 40}
!23 = !{!18, !10, i64 48}
!24 = !{!18, !10, i64 64}
!25 = !{!18, !10, i64 56}
!26 = !{!27, !27, i64 0}
!27 = !{!"long", !7, i64 0}


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

%struct.ups_parameter_t = type { i32, i64 }
%struct.ups_key_t = type { i16, ptr, i32, i32 }
%struct.ups_record_t = type { i32, ptr, i32 }
%struct.uqi_plugin_t = type { ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }

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

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

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

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

22:                                               ; preds = %21, %18
  %23 = getelementptr inbounds i8, ptr %8, i64 8
  %24 = getelementptr inbounds i8, ptr %8, i64 16
  br label %34

25:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #5
  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 72, ptr nonnull %11) #5
  %26 = getelementptr inbounds i8, ptr %11, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %26, i8 0, i64 56, i1 false)
  store ptr @.str.5, ptr %11, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %11, i64 8
  store i32 2, ptr %27, align 8, !tbaa !12
  %28 = getelementptr inbounds i8, ptr %11, i64 24
  store ptr @mycount_init, ptr %28, align 8, !tbaa !13
  %29 = getelementptr inbounds i8, ptr %11, i64 32
  store ptr @mycount_cleanup, ptr %29, align 8, !tbaa !14
  %30 = getelementptr inbounds i8, ptr %11, i64 40
  store ptr @mycount_single, ptr %30, align 8, !tbaa !15
  %31 = getelementptr inbounds i8, ptr %11, i64 48
  store ptr @mycount_many, ptr %31, align 8, !tbaa !16
  %32 = getelementptr inbounds i8, ptr %11, i64 64
  store ptr @mycount_results, ptr %32, align 8, !tbaa !17
  %33 = call i32 @uqi_register_plugin(ptr noundef nonnull %11) #5
  %.not25 = icmp eq i32 %33, 0
  br i1 %.not25, label %43, label %42

34:                                               ; preds = %22, %40
  %.030 = phi i32 [ 0, %22 ], [ %41, %40 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %.lhs.trunc = trunc nuw i32 %.030 to i16
  %35 = urem i16 %.lhs.trunc, 30
  %narrow = add nuw nsw i16 %35, 1
  %36 = zext nneg i16 %narrow to i32
  store i32 %36, ptr %6, align 4, !tbaa !18
  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 24, ptr nonnull %8) #5
  store i32 4, ptr %8, align 8, !tbaa !19
  store ptr %6, ptr %23, align 8, !tbaa !21
  store i32 0, ptr %24, align 8, !tbaa !22
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = call i32 @ups_db_insert(ptr noundef %37, ptr noundef null, ptr noundef nonnull %7, ptr noundef nonnull %8, i32 noundef 0) #5
  %.not29 = icmp eq i32 %38, 0
  br i1 %.not29, label %40, label %39

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

40:                                               ; preds = %39, %34
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %41 = add nuw nsw i32 %.030, 1
  %exitcond.not = icmp eq i32 %41, 10000
  br i1 %exitcond.not, label %25, label %34, !llvm.loop !23

42:                                               ; preds = %25
  call void @error(ptr noundef nonnull @.str.6, i32 noundef %33)
  br label %43

43:                                               ; preds = %42, %25
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %12) #5
  %44 = getelementptr inbounds i8, ptr %12, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %44, i8 0, i64 64, i1 false)
  %45 = getelementptr inbounds i8, ptr %12, i64 8
  store i32 1, ptr %45, align 8, !tbaa !12
  store ptr @.str.7, ptr %12, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %12, i64 56
  store ptr @equals10_predicate, ptr %46, align 8, !tbaa !25
  %47 = call i32 @uqi_register_plugin(ptr noundef nonnull %12) #5
  %.not26 = icmp eq i32 %47, 0
  br i1 %.not26, label %49, label %48

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

49:                                               ; preds = %48, %43
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = call i32 @uqi_select(ptr noundef %50, ptr noundef nonnull @.str.8, ptr noundef nonnull %9) #5
  %.not27 = icmp eq i32 %51, 0
  br i1 %.not27, label %53, label %52

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

53:                                               ; preds = %52, %49
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  call void @uqi_result_get_record(ptr noundef %54, i32 noundef 0, ptr noundef nonnull %10) #5
  %55 = getelementptr inbounds i8, ptr %10, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = load i64, ptr %56, align 8, !tbaa !26
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i64 noundef %57)
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  call void @uqi_result_close(ptr noundef %59) #5
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = call i32 @ups_env_close(ptr noundef %60, i32 noundef 1) #5
  %.not28 = icmp eq i32 %61, 0
  br i1 %.not28, label %63, label %62

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

63:                                               ; preds = %62, %53
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @mycount_cleanup(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden void @mycount_many(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #0

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

declare i32 @uqi_register_plugin(ptr noundef) local_unnamed_addr #4

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

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

declare void @uqi_result_get_record(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @uqi_result_close(ptr noundef) local_unnamed_addr #4

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

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, !6, i64 0}
!10 = !{!"", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !6, i64 24}
!14 = !{!10, !6, i64 32}
!15 = !{!10, !6, i64 40}
!16 = !{!10, !6, i64 48}
!17 = !{!10, !6, i64 64}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !11, i64 0}
!20 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16}
!21 = !{!20, !6, i64 8}
!22 = !{!20, !11, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!10, !6, i64 56}
!26 = !{!27, !27, i64 0}
!27 = !{!"long", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass