; LLVM IR from themisvaltinos/Partitioned-Hash-Join :: tests (test_helpers)

; 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.__va_list_tag = type { i32, i32, ptr, ptr }

@acutest_test_already_logged_ = external hidden global i32, align 4
@acutest_verbose_level_ = external hidden global i32, align 4
@acutest_case_already_logged_ = external hidden global i32, align 4
@acutest_case_name_ = external hidden global [64 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare hidden void @acutest_line_indent_(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @acutest_colored_printf_(i32 noundef, ptr noundef, ...) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #2

; Function Attrs: nounwind uwtable
define dso_local void @acutest_case_(ptr noundef %0, ...) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca [1 x %struct.__va_list_tag], align 16
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #4
  %5 = load i32, ptr @acutest_verbose_level_, align 4, !tbaa !9
  %6 = icmp slt i32 %5, 2
  br i1 %6, label %7, label %8

7:                                                ; preds = %1
  store i32 1, ptr %4, align 4
  br label %31

8:                                                ; preds = %1
  %9 = load i8, ptr @acutest_case_name_, align 16, !tbaa !11
  %10 = icmp ne i8 %9, 0
  br i1 %10, label %11, label %12

11:                                               ; preds = %8
  store i32 0, ptr @acutest_case_already_logged_, align 4, !tbaa !9
  store i8 0, ptr @acutest_case_name_, align 16, !tbaa !11
  br label %12

12:                                               ; preds = %11, %8
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %12
  store i32 1, ptr %4, align 4
  br label %31

16:                                               ; preds = %12
  %17 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %3, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %17)
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %3, i64 0, i64 0
  %20 = call i32 @vsnprintf(ptr noundef @acutest_case_name_, i64 noundef 63, ptr noundef %18, ptr noundef %19) #4
  %21 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %3, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %21)
  store i8 0, ptr getelementptr inbounds ([64 x i8], ptr @acutest_case_name_, i64 0, i64 63), align 1, !tbaa !11
  %22 = load i32, ptr @acutest_verbose_level_, align 4, !tbaa !9
  %23 = icmp sge i32 %22, 3
  br i1 %23, label %24, label %30

24:                                               ; preds = %16
  call void @acutest_line_indent_(i32 noundef 1)
  %25 = call i32 (i32, ptr, ...) @acutest_colored_printf_(i32 noundef 3, ptr noundef @.str.2, ptr noundef @acutest_case_name_)
  %26 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !9
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr @acutest_test_already_logged_, align 4, !tbaa !9
  %28 = load i32, ptr @acutest_case_already_logged_, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr @acutest_case_already_logged_, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %24, %16
  store i32 0, ptr %4, align 4
  br label %31

31:                                               ; preds = %30, %15, %7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #4
  %32 = load i32, ptr %4, align 4
  switch i32 %32, label %34 [
    i32 0, label %33
    i32 1, label %33
  ]

33:                                               ; preds = %31, %31
  ret void

34:                                               ; preds = %31
  unreachable
}

; Function Attrs: nounwind
declare i32 @vsnprintf(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { 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 #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 = !{!"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 = !{!7, !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.__va_list_tag = type { i32, i32, ptr, ptr }

@acutest_test_already_logged_ = external hidden local_unnamed_addr global i32, align 4
@acutest_verbose_level_ = external hidden local_unnamed_addr global i32, align 4
@acutest_case_already_logged_ = external hidden local_unnamed_addr global i32, align 4
@acutest_case_name_ = external hidden global [64 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare hidden void @acutest_line_indent_(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @acutest_colored_printf_(i32 noundef, ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #2

; Function Attrs: nounwind uwtable
define dso_local void @acutest_case_(ptr noundef readonly %0, ...) local_unnamed_addr #1 {
  %2 = alloca [1 x %struct.__va_list_tag], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  %3 = load i32, ptr @acutest_verbose_level_, align 4, !tbaa !5
  %4 = icmp slt i32 %3, 2
  br i1 %4, label %20, label %5

5:                                                ; preds = %1
  %6 = load i8, ptr @acutest_case_name_, align 16, !tbaa !9
  %.not = icmp eq i8 %6, 0
  br i1 %.not, label %8, label %7

7:                                                ; preds = %5
  store i32 0, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  store i8 0, ptr @acutest_case_name_, align 16, !tbaa !9
  br label %8

8:                                                ; preds = %7, %5
  %9 = icmp eq ptr %0, null
  br i1 %9, label %20, label %10

10:                                               ; preds = %8
  call void @llvm.va_start.p0(ptr nonnull %2)
  %11 = call i32 @vsnprintf(ptr noundef nonnull @acutest_case_name_, i64 noundef 63, ptr noundef nonnull %0, ptr noundef nonnull %2) #4
  call void @llvm.va_end.p0(ptr nonnull %2)
  store i8 0, ptr getelementptr inbounds (i8, ptr @acutest_case_name_, i64 63), align 1, !tbaa !9
  %12 = load i32, ptr @acutest_verbose_level_, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 2
  br i1 %13, label %14, label %20

14:                                               ; preds = %10
  call void @acutest_line_indent_(i32 noundef 1)
  %15 = call i32 (i32, ptr, ...) @acutest_colored_printf_(i32 noundef 3, ptr noundef nonnull @.str.2, ptr noundef nonnull @acutest_case_name_)
  %16 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %18 = load i32, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %10, %14, %8, %1
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @vsnprintf(ptr nocapture noundef, i64 noundef, ptr nocapture noundef readonly, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { 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 #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 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass